MDL-33891 Ensure that listen events are cancelled correctly when closing the dialogue