Add error handling if ftell fails
Add error handling if ftell fails

As reported by Coverity Scan

tbeu/matio,NJannasch/matio,MaartenBent/matio,NJannasch/matio,MaartenBent/matio,tbeu/matio,MaartenBent/matio,MaartenBent/matio,tbeu/matio,tbeu/matio