Fix stdout close for child processes.