The midterm results laid bare the deep unpopularity of the war of choice that President Trump started.