Fix race condition in XmppServerConnection cleanup.

Change-Id: I98278f87fb4529891e5e1091b2240b832fd93649