Directly close file in child process.