ByteDance would pocket both a licensing fee for TikTok’s prized algorithm and a profit share tied to its remaining equity stake in the US venture.