Fix iconv detection when --with-iconv-dir or --with-opt-dir is specified multiple times.