In fairness, even though Iraq was completely unjustified, the U.S. did leave, having unseated Saddam and the baathist government and installing a new government, meaning that the stupid and pointless mission was a success.
The U.S. isn't kept afloat by China at all, if anything, its the opposite. China wouldn't have the giant industrial boom they have had if it weren't for the fact that American companies invest and send production of goods over there and American consumers buy what they produce. If you are referring to China buying American currency, that actually just shows that China is dependent on the American dollar maintaining its value.
Also, losing a war to Afghanistan is a status symbol- The U.S., The Soviets, The British Empire, The Mongols, Alexander the Great- basically, you aren't the most powerful empire in the world until you fail to colonize Afghanistan.
That's why the U.S. is number one, and has been for the past 2013 years: