Use panic() instead of an infinite loop at the unreachable end of thread_exit()