Implement flushing and improve request tracking.

BUG: https://b/29937783, https://b/32941326
TEST: unit tests pass, fixes 8 failing cts tests
Change-Id: Idc390bdc1e51ba2bdbda91d90acc459a09a5f174
diff --git a/modules/camera/3_4/v4l2_gralloc.cpp b/modules/camera/3_4/v4l2_gralloc.cpp
index 0b093ea..7da3c4e 100644
--- a/modules/camera/3_4/v4l2_gralloc.cpp
+++ b/modules/camera/3_4/v4l2_gralloc.cpp
@@ -321,6 +321,7 @@
     // The BufferData entry is always dynamically allocated in lock().
     delete entry.second;
   }
+  mBufferMap.clear();
 
   // If any unlock failed, return error.
   if (failed) {