Problem
Dash has the same security issue described in bitcoin PR bitcoin#29307.
fclose(3) failure may prevent previously written data from being properly flushed to disk. Current code ignores fclose(3) failures, leaving file close errors undetected and unhandled.
Upstream Fix
PR bitcoin#29307: "util: explicitly close all AutoFiles that have been written"