Rework message_set decoding to prevent badmatch on truncation

The previous implementation required incoming message sets to be
well-formed. Any message set truncated halfway through would cause
the various binary parses to badmatch.