apply mask or state mode to copied files.

This makes salt.utils.copyfile secure by default. After use, correct file
permissions according to the mode in the state or, if not specified, the umask.