(#20072) Redirect stderr to the correct null device on windows

Previously the virt_what method redirected stderr to /dev/null, which fails on
windows. This commit adds a case for windows where the stderr is redirected to
NUL, the windows null device. It also adds tests to ensure this behavior.