Fix leaked listeners (where new listeners were created but the old ones weren't removed), fixes #16867 on trunk !strict.