TikTok reached an agreement with Oracle and Walmart, in which the two American companies would buy a stake in the app in exchange for supplying secure technology.