Rewrite jid comparison for job cache cleanup

Previous iteration was naive, just converted the first 10 characters of
the jid to integers and subtracted.  However, that means that any time
we go tick over midnight, it adds 76 to the difference (since hours are
not tracked in base 10).  Now, we parse out the jid, convert to a
datetime object, and compare using a timedelta object.

Will not cherry-pick cleanly, so I will submit that as a secondary pull request.