Fix NPE in ActivityStack.ensureActivitiesVisibleLocked

Follow-up to ag/3345710 where we add call to the display object.
It is possible for ensureActivitiesVisibleLocked to be called
when the stack has been removed from the display and no longer
has any tasks. So, we need to check if the stack is attached to
the display before trying to access it.

Change-Id: I9d7c3d00c1af1813b2c408339188fcef2c1a1a6f
Fixes: 72107481
Test: manual
1 file changed