Heterotic string-loop calculation of the anomaly cancelling term