RavenDB-2431 Make sure in-memory-indexes get written to disk when dispos...

...ing the document store