The absence of Mr. Khamenei during the war had suggested heavy security for the Iranian leader, who has final say on all state matters.