convert GDAL no data value to a value representable by data type, fixes #3840