sockfilt.c: Added wrapper functions to fix Windows console issues

The new read and write wrapper functions support reading from stdin
and writing to stdout/stderr on Windows by using the appropriate
Windows API functions and data types.