Fix soong config hash missing for some modules

Bug: 279362051
Test: see outputs of C++ modules using soong config
Change-Id: I95e41350ff17a989faf7c010a4c4ed4fcd79d66b
diff --git a/android/paths.go b/android/paths.go
index 0f3d972..94fa89c 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -1472,14 +1472,11 @@
 	ModuleName() string
 	ModuleDir() string
 	ModuleSubDir() string
+	SoongConfigTraceHash() string
 }
 
 func pathForModuleOut(ctx ModuleOutPathContext) OutputPath {
-	soongConfigHash := ""
-	if i, ok := ctx.(interface{ ModuleSoongConfigHash() string }); ok {
-		soongConfigHash = i.ModuleSoongConfigHash()
-	}
-	return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir(), soongConfigHash)
+	return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir(), ctx.SoongConfigTraceHash())
 }
 
 // PathForModuleOut returns a Path representing the paths... under the module's