Misc fixes.

- rsync in tmp directory and move it into place when done.
- Do not use mktemp.