Apple lost its top spot in China’s smartphone market, dethroned by local rival Xiaomi as Beijing’s consumption-boosting subsidies help buoy demand for cheaper products.