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/TaskStackContainersTests.java b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
index 71bcae7..ca1994f 100644
--- a/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/TaskStackContainersTests.java
@@ -54,8 +54,8 @@
         // Stack should contain visible app window to be considered visible.
         final Task pinnedTask = createTaskInStack(mPinnedStack, 0 /* userId */);
         assertFalse(mPinnedStack.isVisible());
-        final WindowTestUtils.TestAppWindowToken pinnedApp = new WindowTestUtils.TestAppWindowToken(
-                mDisplayContent);
+        final WindowTestUtils.TestAppWindowToken pinnedApp =
+                WindowTestUtils.createTestAppWindowToken(mDisplayContent);
         pinnedTask.addChild(pinnedApp, 0 /* addPos */);
         assertTrue(mPinnedStack.isVisible());
     }