use copy2 instead of copyfile.

copy2 will copy perms and metadata