Fix windows build.

Got rid of all windows warnings.

Fixed a crash bug in ws_global_init when evdns_base_new fails (it would
free the ws_base_t before it freed the event base with in it.