China’s leading solar equipment makers, reeling from overcapacity and plunging profits, are pivoting to the fast-growing energy storage market to stabilize their businesses.