[scripts] preserve permissions of source files
[scripts] preserve permissions of source files

When rewriting source files with REPLACE_OS_VARS=true, preserve the
permissions of the source file so that we never overwrite permissions
when running the control script as a different user than the release was
deployed with

Fixes #412

bitwalker/distillery,bitwalker/distillery