Clean up thread resource in Nuwa