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.
Merge pull request #54 from nh2/fix-lost-echo-output

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