Don't throw InvalidOperationException when WebSocket closed mid-message

#1607