Only link the MTE notes against executables.

Soong has equivalent logic but it was missing on the .mk side.

Bug: 135772972
Change-Id: I5fc5a387313f6ae43c6510ee63d153aa81fb58b1
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 228bad6..e0b8fde 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -211,10 +211,12 @@
 
 ifneq ($(filter memtag_heap,$(my_sanitize)),)
   # Add memtag ELF note.
-  ifneq ($(filter memtag_heap,$(my_sanitize_diag)),)
-    my_whole_static_libraries += note_memtag_heap_sync
-  else
-    my_whole_static_libraries += note_memtag_heap_async
+  ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
+    ifneq ($(filter memtag_heap,$(my_sanitize_diag)),)
+      my_whole_static_libraries += note_memtag_heap_sync
+    else
+      my_whole_static_libraries += note_memtag_heap_async
+    endif
   endif
   # This is all that memtag_heap does - it is not an actual -fsanitize argument.
   # Remove it from the list.