Testing how to reliably unregister listeners