Fix race condition in XmppServerConnection cleanup.

Change-Id: Ib056386c0c85d62f4e5849bedc73b5d296207136