create tempfiles in the destination directory to avoid cross-filesystem issues