The 86-year-old Khamenei was Iran's commander-in-chief and had the final say on all policy and religious matters