Shutdown background thread gracefully in onStop