Define -D_REENTRANT to ensure errno is threadsafe

Change-Id: I127f295703b0258c934a694569c8b56b014069b5
Reviewed-on: http://review.couchbase.org/24543
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>