Fix DiskStore concurrency issue.

DiskStore.__setitem__ is not atomary and a host of errors can be thrown under
load. This method has been made threadsafe.