CORE-5791: lock jobs in the database before attempting to update their statuses