Fix race condition in XmppServerConnection cleanup.

Change-Id: I252f130d8d6ec8fbe816a904a302e4f1b1a6ecc4