Capture output at another thread.