Only close rule file if it could be opened.