In a deal valued at $4 billion, Boyu Capital will acquire a stake in the coffee giant’s 8,000 stores in China.