* Fixes an assertion introduced in commit 1ad73212dca0cf.
* Use itr = std::unordered_map<...>::erase for updating the iterator.
(cherry picked from commit d9755c637c39e600f145f5ecb7ff0ccf3724b1ad)
* 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 1ad73212dca0cf8a829d15ffdbcc4cd611e64d4e)