Generate module targets per-variant

Previously, the module target was only generated for the final varinat,
but it visited all its other variants to get output files from them.
This was mostly fine, except for that now there's ctx.Device() and
ctx.Target().HostCross checks in it. For a module with both device and
host variants, only one of these checks would apply to all variants
of the device, leading to missing -target or -host phonies.

Instead, just create the phonies on all variants. We'll rely on the
fact that phonies are merged/deduped, so saying `m foo` will still
build all variants of foo. But now `m foo-host` or `m foo-target`
will correctly only build the host or target variants.

Fixes: 400503755
Test: atest CtsCompilationTestCases:android.compilation.cts.CompilationTest on a soong-only build
Change-Id: I4896a6cb0461b373ec1853809fa862f9b852096c
diff --git a/android/prebuilt_test.go b/android/prebuilt_test.go
index 27a68fb..d31fc4f 100644
--- a/android/prebuilt_test.go
+++ b/android/prebuilt_test.go
@@ -551,6 +551,9 @@
 }
 
 func (s *sourceModule) Srcs() Paths {
+	if s.src == nil {
+		return nil
+	}
 	return Paths{s.src}
 }