The overall rate was incorrect when using non-default intervals. Also
simplify the code using plain nanosecond values, and fix the rate for
the last event which was based on the number of sleeps instead of the
actual time elapsed.
1. Generate random WS connection key
2. Read headers returned in WS connection (upgrade) response
3. Validate Sec-WebSocket-Accept return value from webdis
Tested by introducing an artificial error in webdis, reported as
expected.
1. Switch to evbuffer for correct handling of partial writes
2. Implement WS state machine in each worker
3. Clean up debug logging
4. Add detailed network log messages to help find WS issues
5. Switch to getopt_long