os/mac: don't use Formula.factory unnecessarily.

Instead check if the path exists by using opt.
shared: don't use Formula.factory unnecessarily.

Instead check if the path exists by using opt.
shared: refactor gcc_version_formula.

Avoid throwing unnecessary exceptions by checking for paths existing and
creating formulae as late as possible. Additionally use instance
variables for some caching.
ENV/std: use full paths to gcc versions.

This is consistent with how e.g. `gcc-4.2` is handled.

This means e.g. `ghc` can find `gcc-4.8` at runtime.

Fixes #28934.
ghc: bump revision to add full compiler path.
ghc: update 7.6.3 bottle.