Check ferror if fread call fails in json_parse_file