perf: Only resolve cc toolchain for rules that will need it (#4593)

This PR is a re-write of
https://github.com/bazel-contrib/rules_go/pull/4591 which was incorrect
- the cc toolchain must be resolved by the rule owning the action that
uses it, it cannot be resolved by a dependent rule (CgoContextData) as
that will not work correctly when there are multiple execution
platforms. See
https://bazelbuild.slack.com/archives/CDBP88Z0D/p1776380536174449 for
discussion
8 files changed