Path integral calculation of string anomalies