simpleperf: add test to app recording api.

1. Modify app_api code to work with new perf event limit in R.
2. Modify demo code to exit after recording. So they can be used
   to generate test apks directly. Use cpu-clock in demo code to
   pass presubmit test.
3. Add api tests in cmd_api_test.cpp.

Bug: none
Test: run simpleperf_unit_test.
Change-Id: I37d786a2f6bdc2af1d807b91796484c58f309e2c
10 files changed