Using HKEY_CURRENT_USER in a service is a mistake. Refer to predefined-keys.
If I replace the call to ReadStringFromRegistry with a call to OutputDebugString then the service will stop properly. So it seems to me that ReadStringFromRegistry with HKEY_CURRENT_USER is probably the cause of the problem.