replace snprintf with LogStream.
Fix build for clang 3.3

Contributed by Benyu Zhang <byzhang@gmail.com>
fix warnings for clang.
update clang.diff
Add superfluous check for Mutex and Condition.

Fixed issue 17.
check return value for pthreads
add rvalue overload for C++11
only evaluate argument once in MCHECK macro.
add check for MCHECK().
fix branch expectation
more branch predication
add Buffer move ctor test for C++11
v0.9.5
cmake related changes.
* Add the toolchain files for building using gcc or llvm/clang.
  E.g.
  mkdir build
  cd build
  cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/llvm-toolchain.cmake -DCMAKE_INSTALL_PREFIX=install ..
  make install # install to build/install
* Some small changes to make both gcc and llvm build, although there are still some warnings in llvm.