Fix monkey NPE

Bug 33177567

Monkey was causing a commit() while the activity was shutting down.
This protects from an NPE in this unlikely situation.

Test: cts-tradefed run singleCommand cts -d --skip-preconditions
      --skip-connectivity-check -m CtsFragmentTestCases

Change-Id: I832cfa8fb187c61b4d2f5a8a4d0f508d7a435171
1 file changed