Check if variable already exists in Mat_VarWrite
Check if variable already exists in Mat_VarWrite

As reported by https://github.com/tbeu/matio/issues/35

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