Fix bug that closed stdout after first file when there is more than one.
Copy input file to temporary file in slave home.