kvargs: fix freeing behaviour for null