Perfprofd: Implement stopProfiling

Change sleep to a condition-variable wait-for. Add some early
exits to the profiling loop.

TODO: Refactor actual profiling to be interruptible.

Test: m
Change-Id: Ia6786225ae2efccd993c7932b97df1fd10d53d2e
3 files changed