Fix callback bugs

There are 2 issues being fixed here:
- In the case that profiling did not successfully start, don't add it to
    the queue. This change is necessary as adding to the queue may
    trigger a cleanup, which in turn may trigger advancing of the
    session prior to the intended advance below. This will cause the
    advancing to skip the error occurred step and therefore skip the
    callback to the app. This will result in callbacks for start
    failures no longer getting queued for later, but this is ok as app
    don't likely care to get a callback for this case unless it's in the
    same immediate.
- Remove the cleanup call after redaction failure. This, similar to the
    above may cause the app callback to never happen as we'll have
    jumped forward past that step. This is ok as the cleanup will still
    occur as part of the natural process.

Both of these issues are intermittent and did not show up locally due to
the cleanup call being posted to another thread so the ordering is not
guaranteed and not always problematic.

Test: run in abtd, presubmit
Bug: 378053144
Flag: EXEMPT - small bugfix
Change-Id: I95c195a9d83608c3a9a2b281bb43da5c1a71f0c5
1 file changed