Remove thread from tree if it's terminated