Check return value of fread