upgrade scripts: Improve check exectuion
This change is to prevent bash from exiting a script with an error when
a command returns a code other than 0, which is expected.
E.g.:
SOME_VAR=$(grep some_value /some/file)
as the "errexit" flag is set, if "some_value" is not found grep will
return exit code 1 and the script will abort. This behavior also varies
with different versions of bash, so it is better in such cases to avoid
invoking commands that may return non-zero code.
Change-Id: I3f9eefc51a37d9762a9b47cc716805957461891f