Protect against assumptions of a top focused stack.

Ibefc3a80, Do the protect against when get top focused stack. Here
are some cases also need to do same thing to guards against the
assumptions that a top focused stack exists.

Bug: 153607881
Test: ActivityStarterTests ActivityRecordTest
Change-Id: I004bdb97ce4c1199b37625ba18bea35ac478f81c
2 files changed