Support disconnect for socket.io versions 0.x to 1.4+
The new functionality was written based on inspecting the socket.io source code of various versions, and light manual testing. Please verify the expected disconnect functionality before releasing in a production environment.