Use Config/DeviceConfig functions to access ProductVariables

An upcoming change will stop exporting ProductVariables from Config, so
switch to using existing accessor functions, and add more when they're
missing.

Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index 40beab8..a4c6898 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -36,7 +36,7 @@
 func newNameResolver(config android.Config) *android.NameResolver {
 	namespacePathsToExport := make(map[string]bool)
 
-	for _, namespaceName := range config.ProductVariables.NamespacesToExport {
+	for _, namespaceName := range config.ExportedNamespaces() {
 		namespacePathsToExport[namespaceName] = true
 	}