Correctly handle locked files on Mac

This change causes files marked as 'Locked' on Mac to be reported as having the FILE_ATTRIBUTE_READONLY flag set, which seems correct for such a file.

It ought to work on some other platforms too, but it's not POSIX compliant and I don't have access to them to test on, so it's a Mac-only fix for now.