Fix memory leak in Mat_VarWrite5
Fix memory leak in Mat_VarWrite5

Reading a compressed v7 variable keeps the internal zlib inflate state open. A subsequent write operation of that variable reuses this internal pointer for the zlib deflate state (and calls deflateEnd after use). Therefore the zlib inflate state needs to be properly freed before the zlib state is allocated.

MaartenBent/matio,MaartenBent/matio,tbeu/matio,MaartenBent/matio,tbeu/matio,tbeu/matio,NJannasch/matio,tbeu/matio,NJannasch/matio,MaartenBent/matio