Apply detached task transactions on animation cleanup

If the task is detached while being animated by recents, the animation
leash may not be cleaned up properly. If the leash draws a shadow,
this would result in a translucent layer on screen that cannot be
dismissed.

The leash was not being cleaned up because when the task is detached,
it will use its own transaction instead of its DC transaction and its
transaction is not reachable.

Bug: 172932178
Test: while dragging app to recents, adb shell am force-stop <package>, drag back to home

Change-Id: Id84319c8ab224c11c6f9ab623b949bba61c761fd
1 file changed