fix CPU usage

make sure to lock the event emitter before dispatching the events so we
don't turn it in a CPU hog