Fix possible crash when removing items from QQmlDelegateModel
When iterating over the cache in QQmlDelegateModel::_q_itemsRemoved(), removing
of some of the items can trigger layout change in the view, which might in turn
remove a QQmlDelegateModelItem from the cache, causing us to dereference an
already deleted pointer.
To prevent crash, we always check whether the item is still valid in the original
cache and skip it if it has been removed in the meanwhile.
Task-number: QTBUG-34351
Change-Id: Ib91a0544e11dbd7bf6d82fa4dc4400cac9d0b5f7
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>