Wait for the thread that echoes captured output Fixes #52.

Until now, we did not wait for the echoing thread.

If the main thread terminated fast, the echoing thread would be
aborted, which cut off the echoed output.