Fixed NPE during monkey testing.

We tried to resume key dispatching for an activity after we destroyed
it and removed its container which led to an NPE.
We now resume key dispatching for an activity if it is currently paused
just before we remove its container to not leave WM in a bad state and
also avoid NPE later on.

Change-Id: I89d366c8667e621f4515df802c6b8278fa4bd322
Fixes: 34808323
Test: adb shell monkey -p ...
1 file changed