fix potential race in the computation of cache state (#3711)
fix potential race in the computation of cache state (#3711)

motivation: fix unstable test

changes: compute the cache state before queueing the delegate call, since otherwise it may compute the state after the cache has been created
apple/swift-package-manager,apple/swift-package-manager,abertelrud/swift-package-manager,abertelrud/swift-package-manager,abertelrud/swift-package-manager,apple/swift-package-manager,apple/swift-package-manager,apple/swift-package-manager,abertelrud/swift-package-manager,abertelrud/swift-package-manager