Improve Windows compatibility when detecting writability in folder.