SF TimeStats: Remove some redundant functions

This change also tunes TimeStats for unittesting purpose.

Bug: 119290000
Test: atest libsurfaceflinger_unittest:TimeStatsTest
Change-Id: I9d9adb589bf4c41d362fa6eab71af094bd82fcb6
diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp
index 0f2a15d..b784d11 100644
--- a/services/surfaceflinger/BufferQueueLayer.cpp
+++ b/services/surfaceflinger/BufferQueueLayer.cpp
@@ -262,7 +262,7 @@
             Mutex::Autolock lock(mQueueItemLock);
             mQueueItems.clear();
             mQueuedFrames = 0;
-            mFlinger->mTimeStats->clearLayerRecord(layerID);
+            mFlinger->mTimeStats->onDestroy(layerID);
         }
 
         // Once we have hit this state, the shadow queue may no longer