Backout changes for CID #11102, descriptors already closed by fclose() or gzclose()