Fix fclose m2t fid

If `m2t` fails, it will lock the directory where it was writing to. Close the opened fid.

Compatibility with Octave should be insured. Compare https://www.gnu.org/software/octave/doc/interpreter/Catching-Errors.html#XREFlasterror vs http://uk.mathworks.com/help/matlab/ref/lasterror.html