* Fixes an assertion introduced in commit 1ad73212dc.
* Use itr = std::unordered_map<...>::erase for updating the iterator.
(cherry picked from commit d9755c637c)
* Immediate deletion caused issues with the SpellEvent,
so we delete it at one of the next update ticks now.
* Only affects the unforced cancellation of events.
* Ref #16675
(cherry picked from commit 1ad73212dc)