Modified Windows process-wait to return status code properly.
Handling status code properly on POSIX environment.