Fix permission check

VirtualStore redirections (since Windows Vista) interfere with the permission detection on Windows.
This fixes it.

See http://stackoverflow.com/questions/20269511/verify-whether-c-program-files-is-writable