BUILD: pools: only detect link-time jemalloc on ELF platforms

The build broke on Windows and MacOS after commit ed232148a ("MEDIUM:
pool: refactor malloc_trim/glibc and jemalloc api addition detections."),
because the extern+attribute(weak) combination doesn't result in a really
weak symbol and it causes an undefined symbol at link time.

Let's reserve this detection to ELF platforms. The runtime detection using
dladdr() remains used if defined.

No backport needed, this is purely 2.6.
diff --git a/src/pool.c b/src/pool.c
index 1d4f2df..4d1d7d2 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -77,9 +77,11 @@
  */
 static void detect_allocator(void)
 {
+#if defined(__ELF__)
 	extern int mallctl(const char *, void *, size_t *, void *, size_t) __attribute__((weak));
 
 	my_mallctl = mallctl;
+#endif
 
 	if (!my_mallctl) {
 		my_mallctl = get_sym_curr_addr("mallctl");