Waiting for listener to be really closed when closing.