On Mac: check stat flags and report the file as FILE_ATTRIBUTE_READONLY if it's marked as Locked in the filesystem
Merge pull request #79 from richard-fine/readonly-io-fix

Correctly handle locked files on Mac