Fixed failed redirection of stderr with some options. At least on Msys2, perl fails to redirect stderr if $value contains newline or other weird characters.