remove trailing slashes from path