Modified the FlushToDisk method in JsonStore.cs to wait for a locked file to be released

Modified the FlushToDisk method in JsonStore.cs to wait for a locked file to be released. Handy when you have multiple processes saving to the same json file at irregular intervals.