Defer TaskFragment removal until appeared

Exception was throw because a TaskFragment was finished before
onTaskFragmentAppeared was called.

Bug: 198361315
Test: launch Settings with WIP CLs listed in the bug
Change-Id: Id794b192cd0db21c00803166358712cdf5e2a209
2 files changed