Support unit tests for non-MSVC builds

The currently included version of cppunit supports compilation only
with MSVC compilers, as it lacks the necessary config-auto.h header
typically generated via configure. Address this by using CMake to
auto-generate the configuration header for all other compilers,
restoring balance to the universe.

Also fix several minor MinGW compilation issues.