Before calling copymode(), check to see if the two files differ in perms

This is an attempt to work around annoying filesystems like CIFS, which
generally don't let you do things like chmod.  CIFS in particular will
expose everything as 0777, so which will be detected by this change