Properly dispose the file stream
Merge pull request #247 from alfaproject/coverity_18126

Properly dispose the file stream