Stops the background thread gracefully.
This method is not strictly required because the thread lives for the lifetime of the application, but it provides a way for graceful shutdown if the host wishes to stop it.