Ayatollah Ali Khamenei ruled Iran for decades, fuelled by paranoia, absolute power and a belief in his own divine destiny.