The deal, set to close on Jan. 22, would end years of efforts to force ByteDance to divest its US business over national security concerns.