Once you've lost something (I think sooner or later, Iran will succeed in sinking a big US ship) then even if you cant win, you also cant leave else its an admission of defeat - so it drags on and on and on.

I'm not sure the US would behave as rationally in that scenario as you hope