China’s factory activity staged a surprise recovery in December, snapping an eight-month contraction streak that was the longest slump on record.