[RFC] CMake: Capture stderr when running tests.

A possible fix for #1301, based on @Islah's last comment there.
Did we decide whether we always want to show error output or only on failure?