Fix flaky AppWindowTokenTests

The only one failure test is marked with corresponding bug ID. Other
flakiness are fixed.

We need to push a guard task when waiting for handler empty to ensure
all the posted tasks is finished after calling the waitHandlerIdle.
Otherwise, it is possible that the assertion happens before the posted
runnable method finished, which will cause fail, and flakiness.

There was a change by default skip onParentChange call for
TestAppWindowToken which breaks the tests. Set the flag correctly in
setUp fixed it.

Bug: 69229402
Bug: 68267650
Test: atest AppWindowTokenTests. All tests other than flaky one should
get a stable pass.

Change-Id: If485232d676604ec4a5b8d2c9e097fd9794d916e
3 files changed