Proposed fix for MCA #181

The fix is essentially adding a lock for all update calls (set(), remove(), clear()), to force updates to happen serially.  The intent was to minimize the scope of the lock in each method.  To ensure consistency, the lock is acquired prior to reading the existing data from storage (so that other writes are seen), and not released until the storage has been written back.