[fix] Properly clean up connections by setting empty handles or removing them.

The issue here is even if we've closed the connection and nulled the variable it
can still emit events. Like a error or close event as we've closed it. To prevent
these event leaks we need to remove all our handlers before we null the socket.