Add negative tests for MsgAlert.

This commit adds tests for the error paths when encoding and decoding
MsgAlert.