Fix IndexOutOfBoundsException while handle app crash

The `mActivities` size could change while the the activity is
detached (r.detachFromProcess).

Bug: 274859740
Test: wm presubmit
Change-Id: I05d7b5a79d3f7cffca707a7ad7cce1b871f0c8ff
1 file changed