Capture output from subprocs during test, and display on failure

This probably needs some more thought on synchronisation so we don't miss
critical bits of output as the test ends.
Don't try to wait for StreamCapturer that was never started
Don't show subprocess output if there isn't any
Use stream capturer for kernel tests
Merge pull request #4393 from takluyver/tests-subproc-stream-capture

Capture output from subprocs during test, and display on failure