Remove unreachable code when thread exits on Linux.