Wait for child processes to terminate to eliminate zombie processes. (similar to 85e8f1a)