The Supreme Court unanimously upheld a law that threatens to shut down the wildly popular TikTok social media platform in the U.S. as soon as Sunday, ruling that free speech rights must yield to concerns that Chinese control of the app creates a national-security risk.