Reduce synchronized section in storeOntologyInternal