Moved cleanup to end of read_mat function

* src/rmatio.c (read_mat): Moved all cleanup of UNPROTECT and pointers
  to end of function