Ninja: Use absolute path to COMSPEC if possible

If the COMSPEC is set to an absolute path, use it instead of just
`cmd.exe`.  This avoids searching for the tool in the current working
directory and the `PATH`.  If COMSPEC is not set to an absolute path,
fall back to the existing behavior.

Issue: #18350
3 files changed