Fix race condition in XmppServerConnection cleanup.

Change-Id: I8adc33bddb42353e99bed06b5364c5ed1edbde4a