Add comments to term_trace_cpu to explain what's going on in more detail.
Make get_thread_list tolerate gdb's thread order not matching order of thread creation.

After 69 successful runs of the full test suite, this issue caused the
70th run to fail.