(RE-1040) Use NUL device on Windows

Previously, we were trying to redirect output from some commands to /dev/null
on Windows which causes errors of the form:

    The system cannot find the path specified.

to be output. This commit adds a is_windows? method and conditionally redirects
to the NUL device instead on Windows.

This commit also uses `Dir.pwd` instead of executing `pwd` as the latter is
is shell built-in not present on Windows.