MINOR: thread: implement ha_thread_relax()

At some places we're using a painful ifdef to decide whether to use
sched_yield() or pl_cpu_relax() to relax in loops, this is hardly
exportable. Let's move this to ha_thread_relax() instead and une
this one only.
diff --git a/include/common/hathreads.h b/include/common/hathreads.h
index a1a7fae..8067467 100644
--- a/include/common/hathreads.h
+++ b/include/common/hathreads.h
@@ -22,6 +22,11 @@
 #ifndef _COMMON_HATHREADS_H
 #define _COMMON_HATHREADS_H
 
+#include <unistd.h>
+#ifdef _POSIX_PRIORITY_SCHEDULING
+#include <sched.h>
+#endif
+
 #include <common/config.h>
 #include <common/initcall.h>
 
@@ -128,6 +133,13 @@
 
 static inline void ha_set_tid(unsigned int tid)
 {
+}
+
+static inline void ha_thread_relax(void)
+{
+#if _POSIX_PRIORITY_SCHEDULING
+	sched_yield();
+#endif
 }
 
 static inline void __ha_barrier_atomic_load(void)
@@ -391,6 +403,15 @@
 	tid_bit = (1UL << tid);
 }
 
+static inline void ha_thread_relax(void)
+{
+#if _POSIX_PRIORITY_SCHEDULING
+	sched_yield();
+#else
+	pl_cpu_relax();
+#endif
+}
+
 /* Marks the thread as harmless. Note: this must be true, i.e. the thread must
  * not be touching any unprotected shared resource during this period. Usually
  * this is called before poll(), but it may also be placed around very slow