Fix Bazel CI by appending the newline to WORKSPACE, which got lost in commit bfaff29b1bafd7892a2197b7cf826e1be0ff3927.

Without the newline, our bazel/scripts/ci/build.sh will append an android_sdk_repository() rule into the file in such a way, that it produces a syntax error.

Also fix the build.sh script to be more resilient and not actually require the newline.

--
MOS_MIGRATED_REVID=130737331
diff --git a/WORKSPACE b/WORKSPACE
index 46a2328..ec8dff7 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -51,4 +51,4 @@
 bind(name = "xcrunwrapper", actual = "@bazel_tools//tools/objc:xcrunwrapper")
 
 bind(name = "protobuf/java_runtime", actual = "//third_party/protobuf:protobuf")
-bind(name = "protobuf/javalite_runtime", actual = "//third_party/protobuf:protobuf-lite")
\ No newline at end of file
+bind(name = "protobuf/javalite_runtime", actual = "//third_party/protobuf:protobuf-lite")
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh
index e98b58b..70e1d89 100755
--- a/scripts/ci/build.sh
+++ b/scripts/ci/build.sh
@@ -69,6 +69,9 @@
     cp WORKSPACE WORKSPACE.bak
     trap '[ -f WORKSPACE.bak ] && rm WORKSPACE && mv WORKSPACE.bak WORKSPACE' \
       EXIT
+    # Make sure that WORKSPACE ends with a newline, otherwise we'll end up with
+    # a syntax error.
+    echo >>WORKSPACE
     cat >>WORKSPACE <<EOF
 android_sdk_repository(
     name = "androidsdk",