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.
Merge pull request #5030 from NVIDIA/buildpy-auto-cwd

Make build scripts set working directory automatically and handle failure