windows: Improve some error reporting in tests

This is an ongoing effort to diagnose #12516