Don't destroy surface if there is no active animation to cancel

It is possible that mAnimatingExit is true but there is no animation
associated to the window because its parent is waiting for transition.
(WMS.tryStartExitingAnimation, WA.applyAnimationLocked, WS.isAnimating)

It may cause flicker during relayout to visible because the surface
is destroyed directly. This change restores the condition as commit
cef37fb4 (removed in commit a5e10572) to avoid the case.

Bug: 113867701
Test: manual - While device is locked with a top show-when-lock activity,
      launch another show-when-lock translucent activity in the same task
      (for transition type activity_translucent_open_enter that is easy
      to hit the timing) and observe there is no flicker (black screen).

Change-Id: I6d47255660d26d9c67bd1a9076a2f14e7ce75cfd
2 files changed