Fix possible reference leaks and crash when re-enter the __next__() method of :class:`itertools.pairwise`.