Former Iranian president Rafsanjani dies of heart attack: state media