Keep local file permissions of transferred files.

Changes file permissions of the file after transferring to the local one.

NB: only POSIX file permissions support is implemented.