WindowTracing: fix deadlock

Do not write WM data to perfetto in the onStart callback.
Offload the writing to the main thread instead and use
DataSourceParams#postponeStop + stopDone() to synchronize
main and perfetto threads.

Bug: 323165543
Flag: EXEMPT bugfix
Test: atest WindowTracingPerfettoTest
Change-Id: Ib58a098a969ccca8d52555bfc01dbf7c2e16bad6
3 files changed