Improve performance on large task queues.

Fix registry.getitem_reset(), registry.popitem(), and registry.popitem_move()
to not try to read every work unit only to find the next available one.
This shows up as TaskMaster.get_work() taking several seconds on very
large task queues.