Check return value from fread()