The Dirac operator under collapse with bounded curvature and diameter