[profiler] Use a semaphore to signal the writer thread.