fix segfault then disconnect by re-write XMPP logic
with a clean re-write, XMPP re-connect logic rocks