Add WaitForProcWithExitCode
Merge pull request #1 from OndroNR/WaitForProcWithExitCode

Added WaitForProcWithExitCode function.
Improved error handling in WaitForProcEx function.