Solved the buffer-not-flushing bug. The reader was throwing an end-of-file
exception, which caused code to skip out of the try block. The writer
(dickens) wasn't in scope in the catch block, so could not have been
flushed there. Solution: move the try-catch into the loop.