Call fclose() in all cases, even in the failure case.