Address thread safety issues in WindowLayoutComponentImpl

Check usages of its class variables (and functions). Added a lock
object, and use it to protect access to class variables in cases
where the calling thread is undefined.

Bug: 242647030
Test: make androidx.window.extensions RUN_ERROR_PRONE=true
      check warnings
Test: Smoke test with Jetpack WindowManager Demos apk
Change-Id: I5050e67a30e4b839f7954d56857f61d13c712140
2 files changed