Set `isRunning` of `Process` to `false` before calling the termination handler
Set `isRunning` of `Process` to `false` before calling the termination handler

Otherwise, we end up in a race condition where `isRunning` might still be `true` when accessed from inside the `terminationHandler`. If this is the case, accessing `terminationReason` or `terminationStatus` inside the termination handler crashes because their precondition that the task has finished are not satisfied.

Fixes rdar://78035044

apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation