lib/inet.c: replace safe_strcpy with strdup for dynamically allocated cache, fixes truncation