Fix interaction between fragmentation, unmasking and inflating in websocket

The unmasking logic was based on the length of inflated data instead
of the length of the deflated data. This meant data would get corrupted
when we receive a websocket frame split across multiple TCP packets.

The defragmentation logic was not handled properly when deflate was
enabled, where a zlib footer was prematurely appended to the unmasked
buffer.