tests: avoid misaligned memory access in InMemoryStorage test

refs #4191

Change-Id: I2b5255c70e07a36fdd6601f24e4468e3d8c00346
diff --git a/tests/unit-tests/ims/in-memory-storage.t.cpp b/tests/unit-tests/ims/in-memory-storage.t.cpp
index 41082c6..3689c53 100644
--- a/tests/unit-tests/ims/in-memory-storage.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage.t.cpp
@@ -733,7 +733,9 @@
     if (content.value_size() != sizeof(uint32_t)) {
       return 0;
     }
-    return *reinterpret_cast<const uint32_t*>(content.value());
+    uint32_t id = 0;
+    std::memcpy(&id, content.value(), sizeof(id));
+    return id;
   }
 
 protected: