return dataset after closing NetCDF connection

Minor change made to the R parser as pointed out by Dirk Slawinski. Please merge.