mesa: Validate count parameters when marshalling.