China has agreed to limit textile exports to South Africa in order to protect the latter's industry in a draft trade deal.