lib/ims: fixed pkg_mem leak when getting service route