Fix directory utilities for win32

Change-Id: I615d84e7c577d5b494d1e23a955cf552b409511f
Reviewed-on: http://review.couchbase.org/31210
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>