lib/socket: use standard type names instead of local typedefs