A group of American and global investors will take control of TikTok's U.S. business under the agreement.