Fail unflushed writes with ClosedChannelException

... instead of cryptic exception message.