Use standard threading locks in the cache types

Instead of using a reader/writer lock in the cache types
just take advantage of the fact that single, non-mutating
operations on dictionaries are thread-safe in python.

This means we can remove the need to have simple read-only
operations using read-locks and can just use a simpler lock
around write-operations or around read/write operations that
span multiple dictionary operations (like iteration).

Change-Id: I4679275d7fe25fac12a6b05e8aa38da95649f4f6
Merge "Use standard threading locks in the cache types"