I don't think you should destroy the detached thread.
Consider threads as processes which share the same memory region. So when a process is forked and child process is completed before the main process, then the return value of the child process is held in kernel memory which can be taken up by parent process.
Detaching a thread is nothing but the indication to theh kernel that theh thread's return or exit status is not required and can be ignored once the thread is completed.
So you don't have to wait for the detached thread to complete at theh end of program since in most POSIX systems, if theh main thread is completed then other threads of that process are also stopped by the system so it is a good idea to wait for the child threads to complete before exiting from main.