Fixed previous build break with thread sanitiser detection.

benchmark_latency now gates the threads to improve concurrency, and calculates
OS sleep overhead.