waf: improve iconv checks
there are broken iconv implementations around (e.g. on AIX) that you
can compile against but that refuse any mapping requests
make sure we do the same as the autoconf-based build did and
fall back to our own code
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10308
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit
15b2d1a658b3fc428c20a7a461168f464951f40f)
(cherry picked from commit
f5cbfd6ce5e5a0977e5c1a53046ee883b3431246)