Do not panic when upgrade info tells to hold

Before running tests, a sanity upgrade was run to gather the amount of
flash writes to be expected for the operation. This operation fails when
the dependencies hold an upgrade, so the checks were updated to avoid
aborting under those circumstances.

Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/src/image.rs b/sim/src/image.rs
index 663835b..fd9fdfe 100644
--- a/sim/src/image.rs
+++ b/sim/src/image.rs
@@ -191,9 +191,11 @@
         // upgrades without fails, counts number of flash operations
         let total_count = match images.run_basic_upgrade(permanent) {
             Ok(v)  => v,
-            Err(_) => {
-                panic!("Unable to perform basic upgrade");
-            },
+            Err(_) =>
+                match deps.upgrades[0] {
+                    UpgradeInfo::Held => 0,
+                    UpgradeInfo::Upgraded => panic!("Unable to perform basic upgrade"),
+                },
         };
 
         images.total_count = Some(total_count);