Make sure the fd we use to communicate with the parent process is not leaked to the child process. Closes #5966