Wait for stdout to drain before exiting.
Merge pull request #52 from metaspace/master

Wait for stdout to drain before exiting.