SF: Move/Refactor LayersNeedingFences

Refactors the logic for handling layers that are being released by the
current display refresh.

This is in preparation for moving the logic over to CompositionEngine.

Test: atest libsurfaceflinger_unittest libcompositionengine_test
Bug: 121291683
Change-Id: I52725b1310ecb324e2c1367f0cbd2eddafacbc4a
7 files changed