Revamp the way we capture and send output.

Output can come before the first test, after the last test, and any goddamned
where in between. JUnit also turns out not to call the callback methods in
pairs in some cases, so we no longer rely on that, and we introduce a separate
"OK, we're done" message just to be sure the prococol session is always
finished.