Powerful general in Iran emerges from hiding as Tehran prepares for Khamenei’s dayslong funeral