Remove some gotos.

These could just be made IOFile's. That way you don't even need to have a separate result variable, since you don't need to care about explicitly calling fclose.