graphics: fix potential leaks for IAllocator

Introduce IAllocatorClient to manage resources owned by a client (e.g., SF
or VTS).  This makes sure there is no resource leak when SF or VTS
crashes.

This also fixes two unrelated bugs

 - sizeof(Buffer) != sizeof(void*) on 32-bit impl.
 - layerCount was not set to 1 in tests

Test: builds and boots
Change-Id: I67f5cdd64b97fb3ce1b931099c25f59cc8517f21
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index e26e9a3..f823570 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -7,10 +7,12 @@
     srcs: [
         "types.hal",
         "IAllocator.hal",
+        "IAllocatorClient.hal",
     ],
     out: [
         "android/hardware/graphics/allocator/2.0/types.cpp",
         "android/hardware/graphics/allocator/2.0/AllocatorAll.cpp",
+        "android/hardware/graphics/allocator/2.0/AllocatorClientAll.cpp",
     ],
 }
 
@@ -21,6 +23,7 @@
     srcs: [
         "types.hal",
         "IAllocator.hal",
+        "IAllocatorClient.hal",
     ],
     out: [
         "android/hardware/graphics/allocator/2.0/types.h",
@@ -29,6 +32,11 @@
         "android/hardware/graphics/allocator/2.0/BnAllocator.h",
         "android/hardware/graphics/allocator/2.0/BpAllocator.h",
         "android/hardware/graphics/allocator/2.0/BsAllocator.h",
+        "android/hardware/graphics/allocator/2.0/IAllocatorClient.h",
+        "android/hardware/graphics/allocator/2.0/IHwAllocatorClient.h",
+        "android/hardware/graphics/allocator/2.0/BnAllocatorClient.h",
+        "android/hardware/graphics/allocator/2.0/BpAllocatorClient.h",
+        "android/hardware/graphics/allocator/2.0/BsAllocatorClient.h",
     ],
 }