Ensure that StringCache is locked before use through the type system.

This should be identical at runtime. This only uses sync::Mutex (a lock-protected container) instead of sync::mutex::Mutex (just a lock).
This also removes the aliasable &mut T (which is not supposed to be aliasable, even though the way the lock happened to be taken before use made it safe.)