Add atomic(9) implementations of atomic operations.

Add atomic(9) implementations of atomic operations.  These are used on
FreeBSD for non-x86 architectures.
diff --git a/configure.ac b/configure.ac
index 3a7a245..f4c2506 100644
--- a/configure.ac
+++ b/configure.ac
@@ -981,6 +981,29 @@
 fi
 
 dnl ============================================================================
+dnl Check for atomic(9) operations as provided on FreeBSD.
+
+JE_COMPILABLE([atomic(9)], [
+#include <sys/types.h>
+#include <machine/atomic.h>
+#include <inttypes.h>
+], [
+	{
+		uint32_t x32 = 0;
+		volatile uint32_t *x32p = &x32;
+		atomic_fetchadd_32(x32p, 1);
+	}
+	{
+		unsigned long xlong = 0;
+		volatile unsigned long *xlongp = &xlong;
+		atomic_fetchadd_long(xlongp, 1);
+	}
+], [je_cv_atomic9])
+if test "x${je_cv_atomic9}" = "xyes" ; then
+  AC_DEFINE([JEMALLOC_ATOMIC9])
+fi
+
+dnl ============================================================================
 dnl Check for atomic(3) operations as provided on Darwin.
 
 JE_COMPILABLE([Darwin OSAtomic*()], [
@@ -1031,7 +1054,7 @@
   fi
 ])
 
-if test "x${je_cv_osatomic}" != "xyes" ; then
+if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then
   JE_SYNC_COMPARE_AND_SWAP_CHECK(32, 4)
   JE_SYNC_COMPARE_AND_SWAP_CHECK(64, 8)
 fi