SF TimeStats: flush and clear layer timestats on layer tear down

This change adds an onDestroy call for TimeStats so that in case of app
ANR or other layer destroying cases without producer disconnecting, the
stats could be cleared for that layer.

Bug: b/79872109
Test: dumpsys SurfaceFlinger --timestats <options>
Change-Id: Icd0da73ace646e034e896a4278a2dc735aca1a1a
3 files changed