Fixes client's bug on connection close

Please see: https://github.com/astro/node-xmpp/issues/106