Fix bug of onClientDisconnected event may not happen when client
disconnected.