A number of small chages to allow the library to build on FreeBSD(x86), ...

This includes several changed to allow the library to build on the following platforms in addition to Linux:
* Solaris 2.10 (x86) 64-bit
* Solaris 2.10 (sparc) 64 bit
* FreeBSD 7.0 (x86) 64 bit

It should build on the 32 bit versions of these platforms as well, but I haven't tested that.

The biggest changes were for Solaris, which doesn't support the `__sync_fetch_and_add/subtract` abstractions, instead using a set of library functions of the form `atomic_add_int` , I've also incorporated the changes from the `feature/bigendian` branch, to support sparc. 

To complicate matters, every system seems to have a slightly different version of the include file `sys/queue.h`, in particular the TAILQ_FOREACH macro is missing in some cases, so I check for this in the CMakeLists.txt