memory management: Remove lock order inversion from _allocateCache(), but others exist.  Also, I'm not sure if what I did in this commit is okay.