ChatWorker now shuts down before socket connection is terminated at app shutdown.