LayerTraceGenerator: Fix layer deletion

Fixes a couple of issues with layer handle tracking which manifested
in the generated trace showing layers which were destroyed.
1. Destroyed handles were not written to proto correctly
2. When a handle was destroyed, it was removed from the tracing handle
to layer id map immediately. but we need to access this mapping in the
tracing thread when writing the transaction to proto.

Test: atest transactiontrace_testsuite
Bug: 235376060
Change-Id: I021be9a3864bdfc61422fc2f751f9bfd5e674059
3 files changed