Fix corner cases in alignment code

We were seeing issues with different amounts of aligned and unaligned
memory, and all the transitions.  This cleanes up the rest of the known
issues.

Change-Id: I219779ddb8a3473e7dcd5c24e18471520003b2c6
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/events/logging/log_backend_test.cc b/aos/events/logging/log_backend_test.cc
index e940948..1ebcde6 100644
--- a/aos/events/logging/log_backend_test.cc
+++ b/aos/events/logging/log_backend_test.cc
@@ -209,7 +209,7 @@
   std::uniform_int_distribution<int> lengths_distribution{
       0, static_cast<int>(lengths.size() - 1)};
 
-  for (int i = 0; i < 100000; ++i) {
+  for (int i = 0; i < 1000; ++i) {
     WriteRecipe recipe;
     int number_of_writes = count_distribution(engine2);
     for (int j = 0; j < number_of_writes; ++j) {