Various win32 compilation fixes

Change-Id: I93fd511028a46d3018009b5738fb9137ebfee62d
Reviewed-on: http://review.couchbase.org/27906
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>