Synchronize all WindowTestsBase and WindowTestUtils methods.

Several WindowManager tests access WindowManager code that assume the WM
lock is already held. This can cause crashes in native code and cause
unexpected behavior. Added synchronize blocks around all helper methods
to avoid adding synchronized blocks in all WM tests methods.

This does not guarantee that all WM tests are synchronized, but handles
a good bulk of them for now.

The largest number of failures were from ZOrderingTests since that tests
creates a lot of windows, making synchronicity issues more likely. Ran
that test class multiple times to ensure I was unable to get the
failure.

Test: ZOrderingTests
Bug: 73966377
Change-Id: I96f586e7ea91223589caef885c87ecded555ab13
Fixes: 72976082
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
index 678aa64..cdcb949 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
@@ -260,7 +260,7 @@
 
         // Call prepareWindowToDisplayDuringRelayout for a windows that are not children of an
         // appWindowToken. Both windows have the FLAG_TURNS_SCREEN_ON so both should call wakeup
-        final WindowToken windowToken = new WindowTestUtils.TestWindowToken(FIRST_SUB_WINDOW,
+        final WindowToken windowToken = WindowTestUtils.createTestWindowToken(FIRST_SUB_WINDOW,
                 mDisplayContent);
         final WindowState firstWindow = createWindow(null, TYPE_APPLICATION, windowToken,
                 "firstWindow");