XCOMMONS-343: Adding an event to an already registered event listener fails unless an event of the same type was added on registration
Better fix + test
(cherry picked from commit c46abba6516dac0e55f932e3815d4631c345f250)