China's factory activity slowed in May, indicating the manufacturing sector is under pressure from weak domestic demand and higher production costs.