install: improve handling of shared groups.

Closes #26184.
Validate the output of xcrun more thoroughly

Noticed when installing Homebrew on a fresh install of 10.7 printed
this:

  -e:204: command not found: Error: /usr/bin/xcode-select returned unexpected error. --version
Just pass arguments
Use feature detection
Fix git version check
Invalidate sudo timestamp before exiting
*Quietly* invalidate the sudo timestamp
Installer should run warning-free
Tweak post-install text
Tweak post-install text further

Closes #28902.
Allow Xcode to satisfy the installer
No, really allow Xcode to satisfy the installer
Use <developer_dir>/usr/bin/git as a heuristic
Direct Linux users to Linuxbrew.

References #29813.