MINOR: threads: add a timer_t per thread in thread_info

This will be used by the watchdog to detect that a thread locked up.
It's only defined on platforms supporting it. This patch only reserves
the room for the timer in the struct. A special value was reserved for
the uninitialized timer. The problem is that the POSIX API was horribly
designed, defining no invalid value, thus for each timer it is required
to keep a second variable to indicate whether it's valid. A quick check
shows that defining a 32-bit invalid value is not something uncommon
across other implementations, with ~0 being common. Let's try with this
and if it causes issues we can revisit this decision.
diff --git a/include/common/compat.h b/include/common/compat.h
index e0f00dc..9b97d82 100644
--- a/include/common/compat.h
+++ b/include/common/compat.h
@@ -104,10 +104,17 @@
 #define F_SETPIPE_SZ (1024 + 7)
 #endif
 
-/* systems without such defines do not know clockid_t */
+/* systems without such defines do not know clockid_t or timer_t */
 #if !(_POSIX_TIMERS > 0) || (_POSIX_C_SOURCE < 199309L)
 #undef clockid_t
 #define clockid_t empty_t
+#undef timer_t
+#define timer_t empty_t
+#endif
+
+/* define a dummy value to designate "no timer". Use only 32 bits. */
+#ifndef TIMER_INVALID
+#define TIMER_INVALID ((timer_t)(unsigned long)(0xfffffffful))
 #endif
 
 #if defined(TPROXY) && defined(NETFILTER)