Add check that prevents datafile from having same name as mod-file

Otherwise, the generated m-file might be called as the datafile, leading to infinite loops. The check cannot be moved to makedataset because M_.fname is not available there.