Preserve iterator state more carefully.

Fixes a crash in iterator_test since all iterator state was being
demolished at StopIteration. Now we only destroy the underlying
iterator, keys, and tup, similar to how Python RangeIterator works.