Windows compatibility.

Fixed hard-coded '/dev/stdout' and wrapped use of POSIX
exit codes from `os` in a dict.