Port IME tasksnapshot over to shell transitions

Grab a tasksnapshet before transition animation so that the
IME is still on the going-away activity.

However, in the transient case, the going-away task is kept
live, so we don't actually take snapshot until commit visibility

Bug: 183993924
Test: atest KeyboardVisibilityControlTest#testRestoreImeVisibility
      atest TransitionTests
Change-Id: I3dd7bd65e5ec127a786db297760a0823c383d5df
7 files changed