network: use getservbyport() only if available