fix possible deadlock when Client.Disconnect is called from an EventListener