Prevent leak of AppWindowTokens.

We need to check to remove ourselves from our previous parents exiting
app list not the list of our new parents. If we check AOSP master AppWindowToken
L333 we can see it used to work this way. This is causing the abandoned starting
window buffer queue bugs in 36703921 by also triggering a leak of the startingdata
and the assosciated viewrootimpl, though the surface ends up destroyed.

Bug: 36703921
Test: Open app, hit back, verify dumpsys window displays "Exiting App Tokens" doesn't grow by one each time.
Change-Id: I07a4df82b2694e9d0eaa1b9299d233c3aa496c3e
1 file changed