util.events: Remove an event's table when it has no more handlers.