Don't mark the websocket transport as connected too early

#2219