Drop socket reference on close.

No issue.
- Prevent the unbounded memory growth caused by maintaining
  a reference to the socket object that is created on every connection.
This connectionId *=2 stuff is a little weird for me. It seems like it's always going to be 0. Are you trying to make some sort of unique id, and if so, wouldn't it be better to use a library that generates the id, rather than opaque arithmetic?