(#18931) Convert the mode to a string for consistency.

In commit 3e592777 file modes were converted from an integer
to an octal string, but missed this one location.  For those of
us who don't convert octal to decimal immediately, this was
confusing.  This patch uses strings for mode consistently,
at least within this file.
(#18931) Extend tests for local

Add tests to verify that local trumps source_permissions across the board.
Add verification that the mode is copied for local sources.