Fix ActivityRecord leak if starting window was transferred.

Some windows would stuck in animating status because we didn't get the
correct top activity which contains the starting window, after apply
animation on this main window it would stuck in animating.

Test: atest AmStartOptionsTests#testDashW_FinishingTop, then check
there is no WindowState leak after test finish.
Bug: 184830058

Change-Id: I8f838427168c157732a50fadfccfc9500a3faccc
3 files changed