Properly set exit code for process.
Supercedes #246.
Includes provisions for buggy behavior of WScript.Quit.
Merge pull request #249 from Microsoft/setProcessExitCode

Properly set exit code for process.