do not change working directory when extracting archives (#13077)
do not change working directory when extracting archives (#13077)

## Motivation

When extracting archives, Pants was passing the empty string as an output directory to Buildfarm to request capture of the working directory. The remote execution client was converting the "." output directory given as part of the `Process` to "" as part of normalizing the relative path. The REAPI spec supports this use case, but [actively discourages its use](https://github.com/bazelbuild/remote-apis/blob/3e816456ee28f01ab2e0abf72306c1f340c7b229/build/bazel/remote/execution/v2/remote_execution.proto#L592-L594) and Buildfarm intentionally does not even support it either.

Buildfarm generates this (somewhat confusing) error instead:

```
Violation: INVALID : One of the input `Directory` has multiple entries with the same file name. This will also occur if the worker filesystem considers two names to be the same, such as two names that vary only by case on a case-insensitive filesystem, or two names with the same normalized form on a filesystem that performs Unicode normalization on filenames.
```

In testing, archive extraction also fails when executing against Buildbarn and Buildgrid and not just Buildfarm.

## Solution

Work around the issue by avoiding changing working directories when extracting files in a Process. Pass options to `unzip` or `tar` to extract into the subdirectory explicitly and then capture that subdirectory explicitly. Then strip the resulting prefix from the `Digest`.

This ensures the remote execution request for archive extraction works regardless of how the server chooses to evaluate the path against which an output directory is evaluated and whether it does or does not support `""` as an output directory.

[ci skip-rust]

[ci skip-build-wheels]
pantsbuild/pants,pantsbuild/pants,benjyw/pants,pantsbuild/pants,pantsbuild/pants,pantsbuild/pants,pantsbuild/pants,benjyw/pants,benjyw/pants,pantsbuild/pants,benjyw/pants,benjyw/pants,benjyw/pants,benjyw/pants