Small cleanup of server/irc/connection.js

* Fix global variable leakage (ae3506f)
* Add missing braces (e8c4bb7)
* Remove superfluous local variables and pass had_error to close event (9478bac)
* Use strict equality (`===`) instead of coercive equality (`==`) (353d261)
* Fix typo in comment (0c0dfa9)