Rewrite jid comparison for keep_jobs

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.
Convert the jid pieces to integers, check for errors
Scrub directory if there's no jid file (corrupted entry)
Merge pull request #11308 from basepi/keepjobsrewrite

Rewrite jid comparison for job cache cleanup