add typedefs to socket.h to improve POSIX compatibility

Some libraries want to use more 'proper' types, so define them in the appropriate place.