perf db-export: Fix thread ref-counting