The two companies on Monday confirmed the sale of Uber China to its bigger rival, ending a two-year, money-losing effort to break into one of the world's toughest markets.