The easiest solution is for the US to realise that China might be feeling somewhat threatened by potentially having American troops on their border and that their warnings are genuine thus causing them to negotiate a back channel agreement that UN forces won't advance any further north than the South Pyongan and South Hamgyong - less the northern halves of Jangin, Bujon, Hochon, and Danchon - provinces creating a 50 mile or so wide unofficial zone from the Chinese border. Any advances beyond that will be made purely by South Korean armed forces, they can also point out that once the matter is settled the UN resolution will have been met and foreign troops can return home.
As for what happens without their intervention the North Koreans are finished with the South Korean forces supported by UN logistics pushing onwards up to the Chinese border. The North Korean leadership evacuates to China, or at an outside chance the Soviet Union, hoping to gain support for re-taking the country but receive little more than refuge and nice words quickly becoming an irrelevance. IIRC Truman had already decided to not run for re-election even though he was eligible so the 1952 Presidential election is still likely to be Stevenson versus Eisenhower, I don't know enough about American politics to say whether victory in Korea would affect the results. At any rate Truman likely gets a better historical write-up than he initially received in our timeline.