engine/util/file: close file handle after usage