Lower latency profiling

Current latency profiles have their tails dominated by writing latency
logs, which is hugely undesirable.

Now when a thread log fills up, push it to a background thread to write
to disk. At shutdown, wait for all latency traces to be flushed.
diff --git a/.gitignore b/.gitignore
index 40f4c47..f059eca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@
 # Temporary test reports
 report.xml
 latency_trace.txt
+latency_trace.*.txt
 
 # port server log
 portlog.txt