Fix bug in node TCP listener

The socket event 'connect' has already fired once the server 'connection' event
handler is called with a socket; hence, we move the on('connect') logic into
the server 'connection' handler.