More robust termination of child processes