The U.S. stock market closed with a modest gain. But U.S.-China relations are reaching a boiling point, threatening the market’s momentum.