mesa: fix memcpy() and memset(0) of non-trivial structs