fix crash when erasing entry while iterating through vector

Broadcast might result in calling Remove on the same object which erases
the entry from the listeners vector. If we create a copy we can still
iterate through the vector as all iterators are still valid.