retry read when fscanf error due to resource unavailable