Use !NotInPlatform instead of !DirectlyInAnyApex for apex required deps

Add required entries to install dependencies on the system image for
dependencies that are available to the platform instead of checking
DirectlyInAnyApex.

This causes some minor changes to the LOCAL_REQUIRED_MODULES passed
to Make for apex modules.  Vendor and product apex modules no longer list
libc.vendor, libm.vendor and libdl.vendor or libc.product, libm.product
and libdl.product, but those should already be installed without help
from the apex.  The media apex no longer depends on libstatssocket,
but libstatssocket (without any suffix) is an uninstallable module in
Make, so that dependency wasn't doing anything.

Bug: 372543712
Test: builds
Change-Id: I3e0e4d5caeb72c0d89107ebda96046450115ec18
diff --git a/apex/apex.go b/apex/apex.go
index dc24df3..8a574fc 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2082,7 +2082,7 @@
 				//
 				// Skip the dependency in unbundled builds where the device image is not
 				// being built.
-				if ch.IsStubsImplementationRequired() && !am.DirectlyInAnyApex() && !ctx.Config().UnbundledBuild() {
+				if ch.IsStubsImplementationRequired() && !am.NotInPlatform() && !ctx.Config().UnbundledBuild() {
 					// we need a module name for Make
 					name := ch.ImplementationModuleNameForMake(ctx) + ch.Properties.SubName
 					if !android.InList(name, a.makeModulesToInstall) {