Make build scripts set working directory automatically and handle failure

The sh and python scripts can now be run without changing the working
directory to utils/build.

This commit also cleans up build.py a bit and adds basic detection of
Closure compiler failure, which can happen when running the script with
an outdated Java version.