Quantum mechanical path integrals in curved spaces and the type-A trace anomaly