The war in Iran fulfilled a longtime goal of the Israeli premier. But it has left him in his worst position in years