remove trailing slashes from paths