Use thread_alive_p in a couple more spots