Microsoft once regarded the idea of quitting China as unthinkable. But in the past five years, at least 15 branch offices and joint ventures in China have been shut.