Conditionally include unistd.h

Change-Id: I19be4ec7486ed29e85c056eabf787a5cf512f502
Reviewed-on: http://review.couchbase.org/30361
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>