Release connections even after a failure to close a file