Make service stop synchronous or asynchronous depending on
the state of running thread. Normally the service will complete
the stop asynchronously when the thread stops running. Also
in case the service thread will decide to finish (in later case of
self-update) it should indicate the stopped state correctly.
Signed-off-by: Yuri Benditovich <[email protected]>