Don't call begin/endIteration on every call

PHP doesn't call beginIteration when you call rewind() twice.
It only calls it if it really is the begin of an Iteration.
Same for endIteration in valid().
If you already reached the end and call it again, it doesn't call endIteration

Fixed at least zend/bad/iterator_025.php

e: this will probably conflict with #2930. So maybe it needs a rebase then.