libthread_db: Skip attaching to terminated and joined threads