Foreign investors have now taken out most of the money they put in China’s stock market this year