factor out a TestSocketChannel and NOOPSelector Provider for improved testability
write buffer for a stream can optionally grow dynamically
general write buffer correctness fixes