Enhance the -liconv check for OS X. Fixes bug 8018.