Close manifest cache DB before calling completion handlers (#5881)
Close manifest cache DB before calling completion handlers (#5881)

Previously, we were relying on `defer` to close the database, but that would mean we're closing it when exiting the scope which is typically *after* we are calling completion handlers. It seems as if we should instead call them before.

Related to rdar://101956252
apple/swift-package-manager,abertelrud/swift-package-manager,abertelrud/swift-package-manager,apple/swift-package-manager,apple/swift-package-manager,abertelrud/swift-package-manager,apple/swift-package-manager,abertelrud/swift-package-manager,abertelrud/swift-package-manager,apple/swift-package-manager