EventEmitter: Prevent same handler to register for the same event

It should only allow a handler function to be registered once per
event type.