simpleperf: check monitored targets regularly.

When monitoring some threads/processes not forked by simpleperf,
check if these threads/processes exist regularly. So we can
stop profiling once all threads/processes exit.

Also handle SIGHUP signal, so we can finish profiling properly
when `adb shell simpleperf record xxx` is killed by Ctrl-C.

Add corresponding tests.

Bug: http://b/33558210
Test: run simpleperf_unit_test.
Change-Id: Ieae4d00d099dc1c7a0c51b0610dff43981bb642e
8 files changed