jabber: Unregister mainloop when reconnecting

Avoid registering the same callback twice by clearing out all old
callbacks before (re)connecting client.

Fixes #42
Merge branch '1.8-stable'