XWIKI-10780: Observation manager does not fully overwrite existing event listener

(cherry picked from commit 987984140f7ac7bdb8950b59c113c744c2ef2a71)