Atomically print log messages

This is implemented only for POSIX API

Change-Id: I7668d62cf103dc821e7ca5b69069ef8ba58f527d
Reviewed-on: http://review.couchbase.org/35200
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>