Update scripts: Ensure clean master, latest npm dependencies, abort on grunt error

* Similar to the updateSubmodules script in mediawiki/extensions/VisualEditor,
  make it easier to run this script by not requiring the user to check out master
  first and ensure it is a clean upstream master and a topic branch etc.

* Run npm-install first to ensure dependencies are up to date.

* Abort if npm-install or grunt failed.
  Otherwise this can cause the update script to create a commit with the
  correct changelog but with a broken or outdated dist copy from
  the local working copy.

* Fix missing newline at EOF.

Change-Id: I200745fa518312be84725d5d858d4df611a41348