close file handles, fixes CID 1222793

Ready for review & merge