Fix tests with file permissions on Windows