Fixes execProcesses wait order. Refs #379.

Closing the stream of the process might terminate it too early for
waitForExit to gather any useful results.