Ensuring port change isn't attempted when listener is active