Use a recursive mutex on notifiers

With the upcoming object event changes, object_event_signal() may call
the object type's unwait function. When the event is implemented using
notifiers, the former is called from notifier_run() and the latter will
call notifier_unregister(), so using a recursive mutex allows this to
happen. Also clean up the notifier code a bit.