Use a check + create transaction when claiming a job

To avoid the case where a secondary entity is able to
consume and remove a job (and its associated lock) while
another entity is in the process of claiming a job by
getting that same lock we want to avoid this by having a
transaction be used that will enforce the job still exists
before the lock is created.

This ensures that a lock is not created on a job that does
not exist in the first place.

Fixes bug 1343029

Change-Id: I6c45cbb9dfb3a479658f4e605d37a6d3ac04d1b8
Merge "Use a check + create transaction when claiming a job"