TikTok will pay $400M to end a US lawsuit over child privacy violations, the Justice Department announced.