Fix fail fast logic on avd_setup.

There were several issues with the logic to handle the retry attempts.

Change-Id: I8dbaeb7fea521ead2dd87cfb1c0882eff7eee6f9
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/54860
Reviewed-by: Ricardo Amador <ricardoamador@google.com>
Reviewed-by: Keyong Han <keyonghan@google.com>
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
diff --git a/recipe_modules/android_virtual_device/resources/avd_setup.sh b/recipe_modules/android_virtual_device/resources/avd_setup.sh
index 1ced355..278e5e3 100644
--- a/recipe_modules/android_virtual_device/resources/avd_setup.sh
+++ b/recipe_modules/android_virtual_device/resources/avd_setup.sh
@@ -69,8 +69,8 @@
     local remaining_attempts=20
     until adb shell true
     do
-      remaining_attemps = remaining_attemps - 1
-      if (( remaining_attempts <= 0 ))
+      ((remaining_attempts--))
+      if [[ remaining_attempts -le 0 ]]
       then
         echo "Emulator not found"
         exit 1