Make Save/Load thread-safe

Before adding code to my project that called Save/Load, I noticed that they weren't using the cache lock to be thread-safe. I've made them threadsafe with locks, and the Save() operation copies out the cache items to a temporary map first so that the lock is never held when doing I/O.