Remove window resize handler after display is closed.