__has_extension support added in gcc >= 14
Fixup mtx_t definition to miror pthread_mutex_t

Index: threads.h
--- threads.h.orig
+++ threads.h
@@ -45,6 +45,10 @@
  * held.
  */
 
+#ifndef __has_extension
+#define __has_extension(_e)	0
+#endif
+
 #if __has_extension(c_thread_safety_attributes)
 #define	__lock_annotate(x)	__attribute__((x))
 #else
@@ -97,7 +101,7 @@
  */
 
 typedef struct pthread_cond	*cnd_t;
-typedef struct pthread_mutex	*mtx_t;
+typedef volatile struct pthread_mutex	*mtx_t;
 typedef struct pthread		*thrd_t;
 typedef int			 tss_t;
 
