libthreads: print out trace at end of execution