SF: Fix thread safety for resync callback

The ResyncCallback for EventThreadConnection reads the HWComposer
pointer and the HWComposer::DisplayData map concurrently with writes
from the main thread. This CL factors that out into a getVsyncPeriod
function protected by mStateLock.

Bug: 74619554
Test: Boot and turn display on/off repeatedly
Change-Id: I9143a5d35b139d44d1e4e7509598b8568e7739aa
3 files changed