Preserve file mode in copySync

This fix the file mode not being preserved when using copySync.