harden job limit enforcement

There should be no change in behavior with the production code,
but this will improve the robustness of the code if someone makes
changes to the logic.