Implement orderly termination of XmppServer

Change-Id: I3acb3889f15c616ad85a2716a147552c43a55ecd