[#1607] Make use of gathering writes for WebSocket encoders, to minimize memory copy