Simple implementation of chmod(path, mode)

currently only integer modes, can do string modes like +x later
fixes #7574
Allow deletion of read-only files on Windows
Merge pull request #7590 from tkelman/tk/chmod

Simple implementation of chmod(path, mode)