Refactor CSimpleFileCache::WaitData, kill race conditions.
Merge pull request #2239 from ulion/fix_simplefilecache_waitdata

Refactor CSimpleFileCache::WaitData, kill race conditions.