Fix the loop timing within dump_thread_stack()