Fix a leaky go-routine on server side connections
Fix a leaky go-routine on server side connections.
The Upgrader.Upgrade method in the server.go was not shutting down the connection cleanly when it had write errors right after the connection was established. This codepath is expected when a non-websocket aware client is trying to connect to the server.
Instead of calling the CloseWithoutFlush, the Upgrader.Upgrade method was closing the underlying network connection ( correctly ), and returning, potentially leaving the flush goroutine abandoned.