[#1058] Fix incorrect logic to detect if ChannelHandlerContext is writable