Lock job/build inserts to guarantee uniqueness on number