[RFC] CMake: Capture stderr when running tests.

Thanks to @Islah, I came up with this fix for #1301.