Don't ensure config for activity that is about to be invisible

We were relaunching an activity in the docked stack that is been
dismissed because we call ensure configuration on it due to the
resize of it been moved to the fullscreen stack. This isn't needed
as the activity is about to become invisible since it is been moved
to a stack that isn't visible.
We now ensuring the configuration if:
- The stack the activity is in shouldn't be visible.
- The activity is currently stopped or stopping.

Change-Id: I6adac6b11a0db4b100e623e4074e169660206567
Fixes: 37118176
Test: Activity in docked stack isn't relaunched when dismissed.
1 file changed