Closing file properly
Merge pull request #63 from cloudfoundry-community/fileclosebug

Proper output file close