A Rigorous Geometric Derivation of the Chiral Anomaly in Curved Backgrounds