Activity in China’s factory sector shrank at its fastest rate in at least three years in August as domestic and export orders tumbled, increasing investors’ fears that the world’s second-largest economy may be lurching toward a hard landing.