Confronting its biggest threat in decades, the regime in Tehran is working to boost its odds of surviving an attack