Fix problem with stderr redirect in Windows
(cherry picked from commit e4b7be7)