some minor fixes to MemoryStore

This is a repeat of #5, moved to its own branch in my repo.

This makes all updates to `currentMemory` `synchronized` on `entries`; it skips on synchronizing the reads where it can get away with it.