events: use emitter.listeners for listenerCount

Call `emitter.listeners(type).length` directly will simplify `EventEmitter.listenerCount(emitter, type)`.