Clean up tracking of layers with buffers

The function to check if the transaction is ready to be applied
should not modify any state. Instead keep track of layers with
ready to be presented outside the check.

Bug: 184063141
Test: atest SurfaceFlinger_test ASurfaceControlTest
Change-Id: I671eabb36195b11c66a1aeefadc78c3d194caeca
2 files changed