WIP.  Still observing buffer overflows.

About to refactor write thread to be a static thread that puts itself
to sleep once it is done writing, and is woken up again by the manage
thread when a buffer is full and ready to write.