China August factory output beats at 5.2% as investment slump deepens