Fixing bug where Socket#onDisconnect wasn't getting called when a socket closed