Fix IGC handling of invalid IGC files

@fredj, proposed fix for #2023.