Prevent concurrent profiling, only hook profiler during profiling.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>