ensure irc socket closes
check if socket is already closed before closing
Merge pull request #819 from mikerodrigues/621

ensure irc socket closes