Various g++/clang config_test fixes

This updates the test files to not use `throw/try/catch` when exceptions are off, to not use `typeid` when RTTI is off, and to not cast a lambda to `void` as this triggers a g++ bug.