[lit] Fix to make "RUN: env PATH=..." work as intended (#165308)
There was a bug in llvm-lit related to setting PATH using env in the
internal shell.
The new PATH wasn't used when looking up the command to be executed. So
when doing things like this in a test case
RUN: mkdir %t
RUN: env PATH=%t program ...
the internal shell would search for "program" using the orignal PATH and
not the PATH set by env when preceeding the command.
It seems like this was a simple mistake in commit 57782eff31e9d454,
since the logic to pick a PATH from the cmd_shenv instead of shenv
actually was added in that patch, but the resulting path wasn't used.