The deal would end years of efforts to force the app’s Chinese parent ByteDance to divest its US business over national security concerns.