Fix assert abstraction in sim

Assertions that are expected to fail under sim test, are now marked as such
using the macro ASSERT which allows to programmatically switch between normal
assert() behavior and captured assertion.

Assertion changes were moved to more appropriate owners and code duplication
was removed.

Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/mcuboot-sys/csupport/bootsim.h b/sim/mcuboot-sys/csupport/bootsim.h
new file mode 100644
index 0000000..f3fc5e4
--- /dev/null
+++ b/sim/mcuboot-sys/csupport/bootsim.h
@@ -0,0 +1,7 @@
+#ifndef H_BOOTSIM_
+#define H_BOOTSIM_
+
+void sim_assert(int, const char *test, const char *, unsigned int, const char *);
+#define ASSERT(x) sim_assert((x), #x, __FILE__, __LINE__, __func__)
+
+#endif