Make install script safer

Call `set -e` to make the script exit if any command fails and `set -u`
to treat unset variables as an error.