Remove tmpfile when cp command fails