Fix the call to iconv on FreeBSD/NetBSD in tests.