Move thread definitions to its own header to avoid redeclaration and redefinition of types which is not allowed in some standards. Fixes #29937 Signed-off-by: Anas Nashif <anas.nashif@intel.com>