REORG: compat: move some integer limit definitions from standard.h to compat.h

Historically standard.h was the location where we used to (re-)define the
standard set of macros and functions, and to complement the ones missing
on the target OS. Over time it has become a toolbox in itself relying on
many other things, and its definition of LONGBITS is used everywhere else
(e.g. for MAX_THREADS), resulting in painful circular dependencies.

Let's move these few defines (integer sizes) to compat.h where other
similar definitions normally are.
diff --git a/include/common/compat.h b/include/common/compat.h
index 1401f91..34d1b35 100644
--- a/include/common/compat.h
+++ b/include/common/compat.h
@@ -31,6 +31,20 @@
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 
+// Redefine some limits that are not present everywhere
+#ifndef LLONG_MAX
+# define LLONG_MAX 9223372036854775807LL
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+#endif
+
+#ifndef ULLONG_MAX
+# define ULLONG_MAX	(LLONG_MAX * 2ULL + 1)
+#endif
+
+#ifndef LONGBITS
+#define LONGBITS  ((unsigned int)sizeof(long) * 8)
+#endif
+
 #ifndef BITS_PER_INT
 #define BITS_PER_INT    (8*sizeof(int))
 #endif