Refs #1413: Avoid infinite loops when restoring the iterator position.