brillo_update_payload: allow specifying delta_generator from env

Help solve the following error when using brillo_update_payload
inside sandboxes:

"delta_generator" is not allowed to be used. See
https://android.googlesource.com/platform/build/+/master/Changes.md#PATH_Tools
for more information."

... by specifying GENERATOR=path/to/delta_generator in the environment.

Test: build GKI
Bug: 162116212
Change-Id: I8e3444539e3692738b0309ab7b1f829d0e840ac2
diff --git a/scripts/brillo_update_payload b/scripts/brillo_update_payload
index 63b6d24..4b581fb 100755
--- a/scripts/brillo_update_payload
+++ b/scripts/brillo_update_payload
@@ -897,7 +897,7 @@
 }
 
 # Sanity check that the real generator exists:
-GENERATOR="$(which delta_generator || true)"
+[[ -x "${GENERATOR}" ]] || GENERATOR="$(which delta_generator || true)"
 [[ -x "${GENERATOR}" ]] || die "can't find delta_generator"
 
 case "$COMMAND" in