WebSocket setTimeout wrap when on iOS

Implementation from https://github.com/LearnBoost/socket.io-client/pull/426