Avoid IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within for loop may delete
the elements from History stack.

Change-Id: Iad9bdc6521b25b12d4c67e6b89f375a99b17748b
CRs-Fixed: 535900