Investors dumped a record $12 billion of Chinese stocks last month as the country’s economy wobbled