Fixed msg_pack() would leak memory if unpack_item() would fail