fix zfile self test assertion

on mingw32, mode_t is an unsigned short. hence the error return of
(mode_t)-1 of zfile_mode() is positive
make zbeacon socket usage compatible with WinSock
Merge pull request #119 from pijyoi/mingw-fix

Mingw fix: zfile assertion and zbeacon winsock compatibility