Fix fd leak when failing to failing to flush to the journal writer.