[THREADS] Auto cleanup the thread handle on exit, unless NO_CLEANUP thread flag is set.