Retain permissions when copying files.
Fixes JENKINS-14269.