drain_buffer.cpp: quick tool to allow fast buffering followed by blocking while buffer drains entirely