Fix race condition in XmppServerConnection cleanup.

Change-Id: I499109232d3f186cd1054452461f83d2a4cd2554