Use WSA error codes when available

Signed-off-by: Thomas B. Ruecker <thomas@ruecker.fi>