Fix ClientWebSocket closing handshake logic (dotnet/corefx#36975)
An HttpListener websocket test was failing after the change from PR dotnet/corefx#36928. That PR made changes
to tighten up the transition to the Closed state after the closing handshake had completed.
That PR missed some additional changes needed especially in cases where a server (such as loopback)
sends the close frame almost concurrently with the client sending the close frame.
This PR fixes the close frame handshake logic and also makes some optimizations in cases where the
websocket has already transitioned to the Aborted state during the closing handshake. In that case,
the websocket should not wait for a close frame to be received but should simply proceed to closing
the connection.
Fixes dotnet/corefx#36963
Commit migrated from https://github.com/dotnet/corefx/commit/
1824535f95defea3ba464599ee4b9937a82eaaf9