Revert "Simplify code to work as it does in other places (35ef5386)."
This reverts commit 123cb8e2.
The reason this code doesn't work is there are other flags set on the
job_state that make it not just Pending.
See test28.2. It has the JOB_UPDATE_DB flag set.