variant: improve error handling in shell scripts

* Add exit handlers to the shell scripts so that if something fails,
we don't leave the repo in a half-committed state.
* Add `set -e` once instead of `|| exit 1` everywhere.
* Bump version numbers in scripts.

BUG=b:149701259
TEST=See detailed test steps in testdata/error_recovery_test.md

Change-Id: Ic038c2cf9e0cd9398bc89edfad8aee96e6669c36
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2422447
Tested-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
7 files changed