Correctly NUL-terminate log buffer

Change-Id: If19ef570617f3a841da87f3f08d3fb51a71ece36
Reviewed-on: http://review.couchbase.org/38543
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>