With sanctions-relief and a US promise to avoid further meddling, the conflict has been settled on Tehran’s terms