simpleperf: work around a simpleperf bug on Android Q.

There is a bug in simpleperf shipped on Android Q, which was fixed in
aosp/971783. It may make simpleperf crash when profiling through Java app
api. So work around it in the Java app api.

Bug: none
Test: run test.py --repeat 100 TestApiProfiler*

Change-Id: Iec5ff9fd9b9a1e522a0b212d44032c386e500d93
6 files changed