reftable: allow reusing iterators across multiple ref lookups
Whenever we look up a ref we create a new set of reftable iterators. This repeated bookkeeping is quite wasteful when doing many random lookups. We should refactor the code so that iterators become reusable.