lib: strip trailing '/' from pathnames (sexp queries).