Make the ItemRepositoryRegistry class a singleton; get rid of locking.
- remove allocateRepository() as we do not have numbered subdirectories
inside the per-session cache location anymore;
- remove locks as the session is already locked very reliably;
- make the ItemRepositoryRegistry a true singleton (private ctor, m_self
field, self() accessor) and make globalItemRepositoryRegistry() a mere
wrapper to ItemRepositoryRegistry::self().
This removed a loop in ItemRepositoryRegistry::open() and thus decreased
nesting level of everything inside the loop, so I took opportunity to
reformat the function body as well.