Add a test that reproduces the issue where resetting the iterator drops the already read packets. Fix a bug in replace_underlying_iterator because checking the self._next function turns out not to work since it points to a bound method so the "is not" check fails.