China's economy is booming only due to export led growth. The reason it is buying dollars is to artificially lower the exchange rate so that Americans find it cheaper to buy Chinese goods. A win-win for both of them.
The day China stops buying the debt, Chinese exports would no longer be competitive, thus it would not want to harm its own economy. So it is in China' own interest to keep on buying the debt.