sha1: Fix warning about possible loss of data

This warning is due to an assignment from size_t to unsigned char.

Change the type of the count variable from unsigned char to site_t to
avoid this warning.

This change is safe because the code doesn't depend on the size of
the sha1_ctxt struct and because the count variable will never store
a value greater than 127.
Unify naming scheme of MAX_*_LENGTH defines
Represent a socket with a struct instead of just an EventHandle
Make Websocket a subclass of Socket

This allows to remove the external passing of WebsocketStorage and
tracking of the socket type.

Also don't call the Websocket receive function if the platform receive
function indicated an error or a disconnect.
websocket: Get rid of calloc call in send function

Use a stack variable with the maximum unextened payload size instead.
websocket: Fix parsing of multiple frames from a single buffer

If multiple frames arrived in a single buffer then the recursive
parsing logic accumulated the payload length incorrectly. Instead
of accumulating the payload length from each parsed frame the
remaining buffer size was accumulated. This resulted in returning
a large payload length that violated the contract of the socket
receive function as the return value could be larger than the
provided buffer length. In the end this triggered a buffer overflow
in the code calling the socket receive function.
websocket: Fix buffer handling in case frame arrives fragmented

If the websocket header is fragmented then upon receiving the
remaining part of the header the code would incorrectly skip a
full websocket header instead of just the remaining part. This
can result in a buffer overflow and misinterpretation of the
data behind the header.

Fix this by skipping only the remaining header part from the data.