Make the query and retry operations work better with big lists.

If a job has hundreds of thousands of work units, the bottom-layer
Redis queries can limit the number of responses they accept, which means
that "get 100 failed jobs" doesn't try to pull the entire list and then
filter.  Also plumb this through the retry operation, so that (a) retrying
works on batches of 1000 failed jobs and not the entire list at once, and
(b) the actual get-the-lock-and-retry operation also works on batches of
jobs and not one at a time.