Removed unused variables and silent warnings

* src/rmatio.c (write_realsxp): Removed unused variable len

* src/rmatio.c (write_intsxp): Removed unused variable len

* src/rmatio.c (write_cell): Removed unused variable nfields

* src/rmatio.c (write_mat): Removed unused variables err and elmt

* src/rmatio.c (read_logical): Refactored function

* src/rmatio.c (read_mat_dat): Return 1 instead of calling error
  on unsupported data_type

* src/rmatio.c (set_dims): Initialize tmp to zero
Added support to read a mat file from an URL

* R/read_mat.r (read.mat): If the filename starts with http:, ftp: or
  https: the URL is first downloaded to a tempfile and then read
Added check of object after allocVector

* src/rmatio.c: Added check of R_NilValue == object, after call to
  allocVector