Implement a ugly way to make the child wait at shutdown (so that the pipes are fully drained).