Don't cache end iterator when modifying the container
Happens to work with Qt5 but breaks with Qt6.
This makes the KSelectionProxyModel unit test continue a bit further with Qt6.
Happens to work with Qt5 but breaks with Qt6.
This makes the KSelectionProxyModel unit test continue a bit further with Qt6.