Fix possible crash when failing to open a text output file