Support the max_wbits websocket deflate parameters.

Slightly improve error handling in the websocket handshake.