add hasDelegates() method to AbstractEvent

Hi,

Normally objects subscribe to events in their constructor, and unsubscribe in their destructor, but a very common mistake (due to copy/paste) is to subscribe again in the destructor. This hasDelegates() method allows to write a custom detector for such situations.