Fix error when the callbacks array changes size while processing an event.

Making an event handler release groups which affect the event being processed, kind of broke things.

(Needed to make things work for stanza.io with reconnecting and not duplicating event handlers)