Global funding for clean-energy projects sagged in 2018 after China’s decision to curb subsidies dragged down installations in the world’s biggest solar market.