message/pack: Check for outstanding bits

Currently, if you pack a non-byte aligned member into a message and then
pack an array, it will do the wrong thing and treat the unaligned data
as being appended to the end of the message. Allowing for this behavior
is convoluted and probably not useful, so just return an error.

Change-Id: I6f200dbea96c41f49a110ba7536ccfd37115d277
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include/ipmid/message/pack.hpp b/include/ipmid/message/pack.hpp
index 18863c4..deb0a5a 100644
--- a/include/ipmid/message/pack.hpp
+++ b/include/ipmid/message/pack.hpp
@@ -239,6 +239,10 @@
 {
     static int op(Payload& p, const std::vector<uint8_t>& t)
     {
+        if (p.bitCount != 0)
+        {
+            return 1;
+        }
         p.raw.reserve(p.raw.size() + t.size());
         p.raw.insert(p.raw.end(), t.begin(), t.end());
         return 0;