Fix for websocket fallback issue #997

Checks if a websocket has never been opened successfully and, in that case, falls back to the alternative transport.