Maintain file modes when copying a directory.

A package may depend on some files in its dependencies being executable,
so builder ought to respect the modes of source files when copying into
a bundle.
Test for #1808
history update for #1808
Merge branch 'pr/1808' into devel