Use forEach in EventEmiiter.emit()

To avoid errors when an event callback removes itself from the
event list (removeListener), which resizes the event callback array length.