Resolves a potential memory leak on shutdown.
Make sure we replace the socket after we're able to handle OnDisconnect().