Correct synchronized object of pinned stack

Also check for whether the stack is detached in extreme cases
because the synchronized scope is not a continuous block in
the callback of animator.

Bug: 118816763
Test: atest ActivityManagerPinnedStackTests# \
      testRemovePipWithVisibleFullscreenStack

Change-Id: I12d4d507fe08b3bd34eed2b00ac531c2cbb2b561
2 files changed