Removed duplicate code

* src/rmatio.c: Removed duplicate code when writing a matvar variable
  to cell, struct or file. Added the function write_matvar.