If you try to /comopen an invalid ProgID or to /sockopen an invalid target, mIRC will automatically close the connection, leaving $comerr or $sockerr with a positive value so you can know that an error occured. But if /fopen fails and $ferr holds 1, the 'name' is still in use although you can't use it.
What I'm suggesting is that to keep the consistency, mIRC will automatically /fclose unsuccessful attempts to open a file.