uggg
Fix bug on unix.

It was a race condition, we need to wait for the exit, and for both pipes to end, before we can say we're done here.