RavenDB-2268 Fixing multithreading issue