Allow event handler functions listen only to subclasses of an event without any errors

Yes, I know it is a lazy way, but at least this can make the removal of EntityDamageByEntityEvent::$handlerList more backwards-compatible.