[xbuild] Fix ProcessWrapper to WaitForExit(..) before accessing ExitCode