fix for windows.
loadIndex() opens for file only for reading and so should use a shared lock (and lock before opening the file)