Add tests for XmppServer shutdown

Fix corner case bug that happens if a XmppServerConnection gets a
delete trigger (result of the XmppServer being deleted) while it's
still on the WorkQueue.

Change-Id: I70b4b6d7f07e2dd682c8f6dc1c4f8da3d42e113a
Fix issue in Xmpp state machine that impacts tests

Increment XmppConnection flap count after setting state to IDLE
or ACTIVE.

Incrementing the flap count prior to udpating the state sometimes
causes issues for tests that first wait for the flap count to go
up and then wait for the state to reach ESTABLISHED again.  They
may see the updated flap count and old state and hence eventually
fail.

Change-Id: I92d90b8ab7b4c83ce64080897f470ce325f8b988
Increment XmppConnection flap count after setting state to IDLE

Change-Id: I79c6599f4b8db51bac9980b85c52bf5798742cf9