Close gdal dataset properly for exporttool.