fix endless recursion when stopping parser

this should fix node-xmpp/node-xmpp-server#31

@shadyvd, could you please check if this works?