Fix C++ test compilation on FreeBSD 9.