Heterotic anomaly cancellation in five dimensions