sim: Prevent reentrancy on simulation

Lock the simulation with a mutex to prevent concurrent access.  The C
code being tested uses globals, and can only be run in one context at a
time.  The Rust test framework may run tests concurrently, so use the
mutex to prevent this.

Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/mcuboot-sys/src/lib.rs b/sim/mcuboot-sys/src/lib.rs
index 16bd6c3..9f5e6b5 100644
--- a/sim/mcuboot-sys/src/lib.rs
+++ b/sim/mcuboot-sys/src/lib.rs
@@ -1,3 +1,4 @@
+#[macro_use] extern crate lazy_static;
 extern crate libc;
 #[macro_use] extern crate log;
 extern crate simflash;