The last-minute calling-off of military action is the first wise decision on Iran the president has taken.