Of course, the north was winning at that point.
Perhaps some better examples might be 1968 and 1952.
Johnson, of course, technically chose not to run for re-election in the middle of the Vietnam war, but that was largely because after the early campaigning it became clear he was going to be defeated in an embarrasing way in the primaries. Hubert Humphrey was the eventual nominee after RFK's assassination took out the best anti-war candidate, and essentially ran as an incumbent, since he was Vice President to Johnson. Richard Nixon ran claiming he had the famous "secret plan" to end the war in Vietnam. It was so secret it wasn't used until December, 1972, when the Christmas bombings forced the North Vietnamese to the bargaining table, where we promptly got our asses out of the war in exchange for nothing but the return of our prisoners. South Vietnam fell two years later.
Ike won in 1952 in part because we thought a military man could do a better job in getting us out of the quagmire of Korea. "I will go to Korea", he said, which was both literal and symbolic: he meant to say he could understand things, in person, better than Truman running via remote control from Washington. Ike, recognizing the military victory was unwinnable, but also recognizing the original war goal was merely to expel North Korea from the south, proceeded to get the war over within six months of assuming office.
In 1944, we re-elected FDR. Again, we were winning the war at that point: an end was in sight: we had clear reasons for being there.
That's it. We've had elections in four wars; half the time we changed horses in mid-stream, half the time we didn't.
As my dad likes to put it, if you want to fight a political campaign with aphorisms, how about: the first rule when you find yoruself in a hole is to stop digging.
I recall in 1999, at my Great Aunt's memorial service, afterwards I was talking with our Texas cousins. George Bush was known mostly to me at that point as the guy who snookered the taxpayers of Arlington and Texas into paying for a ballparrk for his ballclub, which he then sold at an appreciated value that was pretty much exactly the amount of money the public had put into the ballpark. So I asked, with genuine curiousity, how good a job Mr Bush had done in Texas. Great, they said. What exactly did he do? I asked. They looked at each other, groping for an answer. "Well," my cousin said, "he was real good on education." "How so?" I asked. "What did he do?" They also looked at each other for a while, and my other cousin said, "Well, he really increased the amount of testing they're doing." "Hunh," I asked. "How come Texas is still at the bottom of the country in test scores like the SAT and so forth then?" They chuckled nervously. This is when I came to understand that Bush's hard core did not have a clue as to why they liked him: it had to do with some weird psychological need, possibly to feel like the guy in charge was definitely not better than them.