Added function to stop service and wait for it to shutdown.