buffer: add test to fill buffer and read.
stream: synthesize EBADF if fd is -1.
buffer: add some more to the tests.