remove trailing slashes from PATH