Exit with the proper error code when a JSON file is invalid