As with all analogies, yours is simply not adequate to address the issue. Leaving Iraq, as well as bringing our troops home from the over 700 bases we have abroad, does not result in anyone "winning". That would necessitate that we were defeated, but defeat cannot take place unless we actually lose. And I firmly believe we can keep fighting in Iraq for a hundred years without losing, although it would bankrupt the nation in the process. What I believe we need is a basic policy change, one that would give us a strong national defense so that we could actually protect our borders.
The same argument could have been made (and probably was) regarding our resolve in WWII, Vietnam, and Korea.
The significant differences between those engagements, is that in WWII we made the commitment to defeat our enemies, we did so, and now those nations are among our chief trade partners, we are at "peace" with them. I would consider Italy, Germany, and Japan all to be very treasured allies.
Contrast that with Vietnam and Korea where we chose options other than victory over our opponents, and you have, at least in the case of Korea, the prolonged presence you suggest could result in Iraq (And I believe you are correct that it could - IF we do not succeed in defeating our enemy there).
In the case of pulling out of Vietnam before we had defeated our enemy, that action did in fact equate to us (and the allies we abandoned) losing and our enemy winning.