Make the websocket handshake statefull

The websocket handshake could not handle being split over multiple
TCP packets since it was entirely handled in on function. This patch
splits it into a socket state making it possible to process over
multiple incoming packaets.

Change-Id: I3c45892ee6f1bb67062d561e9fbd2d7296f1208e
Task-number: QTBUG-40878
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>