Added ``unique_id_uses_count`` to hooks.

This parameter acts like a semaphore/recursive lock for an event with a
unique id such that the event can only be completely removed once the number
of unregister calls to the event equals the number of times it has been
registered.  The unique id event is still only registered once despite multiple
register calls when unique id is used.