improve: close hgkvfile input immediately (#155)