buildscripts: check errorlevel of error-prone commands in .bat files

There's no 'set -e' in BAT, so we get to do it manually. Wee!

Note that we need to use 'exit /b' instead of 'exit' in the scripts, as
otherwise it exits more than just the current script.
diff --git a/buildscripts/kokoro/windows.bat b/buildscripts/kokoro/windows.bat
index d1aecb9..842dfa7 100644
--- a/buildscripts/kokoro/windows.bat
+++ b/buildscripts/kokoro/windows.bat
@@ -19,8 +19,8 @@
 @rem Clear JAVA_HOME to prevent a different Java version from being used
 set JAVA_HOME=
 set PATH=C:\Program Files\java\jdk1.8.0_152\bin;%PATH%
-call "%VS120COMNTOOLS%\vsvars32.bat"
-call "%WORKSPACE%\buildscripts\make_dependencies.bat"
+call "%VS120COMNTOOLS%\vsvars32.bat" || exit /b 1
+call "%WORKSPACE%\buildscripts\make_dependencies.bat" || exit /b 1
 
 cd "%WORKSPACE%"
 
@@ -40,4 +40,4 @@
 )
 @echo on
 
-exit %GRADLEEXIT%
+exit /b %GRADLEEXIT%
diff --git a/buildscripts/make_dependencies.bat b/buildscripts/make_dependencies.bat
index 60ae6cd..15199bf 100644
--- a/buildscripts/make_dependencies.bat
+++ b/buildscripts/make_dependencies.bat
@@ -2,7 +2,7 @@
 set CMAKE_NAME=cmake-3.3.2-win32-x86
 
 if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (
-  call :installProto
+  call :installProto || exit /b 1
 )
 
 echo Compile gRPC-Java with something like:
@@ -15,27 +15,27 @@
 where /q cmake
 if not ERRORLEVEL 1 goto :hasCmake
 if not exist "%CMAKE_NAME%" (
-  call :installCmake
+  call :installCmake || exit /b 1
 )
 set PATH=%PATH%;%cd%\%CMAKE_NAME%\bin
 :hasCmake
 @rem GitHub requires TLSv1.2, and for whatever reason our powershell doesn't have it enabled
-powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }"
-powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }"
+powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }" || exit /b 1
+powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('protobuf.zip', '.') }" || exit /b 1
 del protobuf.zip
 pushd protobuf-%PROTOBUF_VER%\cmake
 mkdir build
 cd build
-cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" ..
-msbuild /maxcpucount /p:Configuration=Release libprotoc.vcxproj
-call extract_includes.bat
+cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" .. || exit /b 1
+msbuild /maxcpucount /p:Configuration=Release libprotoc.vcxproj || exit /b 1
+call extract_includes.bat || exit /b 1
 popd
 goto :eof
 
 
 :installCmake
 
-powershell -command "& { iwr https://cmake.org/files/v3.3/%CMAKE_NAME%.zip -OutFile cmake.zip }"
-powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('cmake.zip', '.') }"
+powershell -command "& { iwr https://cmake.org/files/v3.3/%CMAKE_NAME%.zip -OutFile cmake.zip }" || exit /b 1
+powershell -command "& { Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('cmake.zip', '.') }" || exit /b 1
 del cmake.zip
 goto :eof