Departure of towering figure in US politics follows her party’s loss of its majority in midterm elections