fix possible deadlock in daemon.shutdown
daemon.shutdown is done in a thread to avoid unneeded ConnectionLostError in proxy when calling this