As China’s economy flashes indications of decline, the consequences pose perils for countries around the globe.