[v6r11] Fix exception when getting metadata with slash at the end

Fix the exception described in ticket https://github.com/DIRACGrid/DIRAC/issues/1874