image: Make netstat check more robust in apt-cacher scripts