[RFC] CMake: Capture stderr when running tests.

Thanks to @Islah, I came up with this fix for #1301.
Do you actually want to key off of `res` here and not show the output at all unless there was an error?  I can honestly go either way on it.  We might accidentally hide a useful warning if we do.  OTOH, we're still displaying useless information most of the time.