It is possible although unlikely that at this point the gen_event server died after the call to get_pid and before the call to add_sup_callback.  In that case, we are going to re-enter this function and register a second callback.  Gen event is dumb and will happily add two, invoking the module twice for each event.  It will also send double notifications in the event of a termination, etc. It might be safer, although hacky, to do the following instead:

* Get list of linked processes
* Get pid of current event mgr after registering the callback. If in the list above, all is well. Otherwise retry, possibly trying to drain any gen_event_EXIT messages from a fast dying event handler, which would cause registration to blindly happen again, possibly ending up in a double registration.

Or maybe we could protect ourselves on entry: check the pid of the current event handler. Are we linked to it? Then the gen_event_EXIT message is probably stale and we shouldn't re-register.  Or go ahead and try to unregister, then register again instead.

What do you think?