Fix concurrent file access issue on windows