Preserve permissions of template files

this allows the executable flag of the rules file
to be properly passed from the template to the
templated result file.