gralloc ashmem hack to delay cb close

Tired of public emulators not working with O

See this CL for context:

https://android-review.googlesource.com/#/c/372376/

This CL moves that to the guest, and detects if
each gralloc cb has been opened at least once
before allowing gralloc_free to call rcCloseColorBuffer.

Images using Treble / HIDL gralloc that have this CL
should work with older emulator versions.

Change-Id: Ice72269e4295497825050385b15dbdec2258100c
diff --git a/Android.mk b/Android.mk
index 566e737..c4b610a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,6 +24,10 @@
 #
 EMUGL_COMMON_CFLAGS := -DWITH_GLES2 -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
 
+ifeq (O, $(PLATFORM_VERSION_CODENAME))
+    EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC
+endif
+
 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 18 && echo PreJellyBeanMr2),PreJellyBeanMr2)
     ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
         EMUGL_COMMON_CFLAGS += -DHAVE_ARM_TLS_REGISTER