The current iconv detection checks if libiconv.so exists via ldconfig,
but fails on glibc systems where iconv is built into libc and doesn't
require separate linking. This causes build failures:
ld: cannot find -liconv: No such file or directory
Replace the ldconfig check with a compile test that actually verifies
if iconv functions are available without additional libraries. This
correctly detects glibc's built-in iconv while still linking -liconv
on musl/uclibc systems that need it.
Fixes build on glibc-based systems including OpenWrt glibc targets.