Target-space anomalies and elliptic indices in heterotic orbifolds