SurfaceFlinger: check fence when acquiring buffer with PTS

This is a fix for a condition where SurfaceFlinger may pass
a buffer to HWC before the fence was signaled. This can happen when
presentation timestamp is set and the buffer behind the front of
the queue has current timestamp.

Test: run a scenario that simulate the scenario
      (PTS is always set to the past)
Bug: 123780024
Change-Id: Ib47bc5ebc50136c54b29bd301ad8d059f3dea947
1 file changed