Refactor parts of the job lock/job condition zookeeper usage

This reduces the necessary locks to operations which really only
need to be locked, removing some of the ones which are not needed
around read only operations or operations which are thread safe
when used with dictionaries (popping a single item for example)
or checking if a *string* key is in a dictionary, or fetching a
dictionaries length...

Change-Id: I28a9d66afa7f7b733b2963b8cee3edd45696561b
Merge "Refactor parts of the job lock/job condition zookeeper usage"