fixes #500 - improved detection of disconnects from irc