Bugfix and add test cases for zone cleanup

* Make listener unregister from emitter when it gets a signal
* Make zone wait for non-cancellable I/O operations