fix data races by locking in functions which do not lock

the go race detector found data races in Emit, whose data accesses are not protected by the mutex. this patch adds the locks to the unprotected functions (Emit, EmitSync, SetMaxListeners