Fix remote-directory for :local-file

The generated temp file previously required unprivileged write permissions in
the target directory.

Fixes #199