Close file descriptor as soon as we have created the temporary file.