This fixes a bug causing `listwalletdir` to strip lead char of wallet name is datadir has a trailing '/'
Co-authored-by: saibato <saibato.naga@pm.me>
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/20080 | core#20080]]