The latency subcommand holds a tree of working atoms sorted by thread's
pid/tid. If there's new thread with same pid and tid, the old working atom is
found and assert bug condition is hit in search function:
Changing the sort function to use thread object pointers together with pid and
tid check. This way new thread will never find old one with same pid/tid.