swconfig: fix memory leak when cli call swlib_get_attr()