websocket_connect should not hang on HTTP errors

Current WebSocket client's implementation only expects 1xx codes in reply and sometimes hangs infinitely when the server says something else, e.g. 404.