Fixed bug in main branch read_websocket

The bug is that read_websocket is advancing the queue before it reads
the mask, so if the queue is longer than one message it will apply the
incorrect mask.  I patched the code to save the mask before it advances
the queue and now messages are processed correctly.  The patched code is
below.  I also fixed two htonl calls to ntohl--this gives the same
result but more accurately reflects the intent of the code--and I added
some comments.