Fixes #4875: Move r32586 to v1.8 branch (Fix the quoting algorithm so)

---svn-pre-commit-ignore-below---

r32586 [[BR]]
Fix the quoting algorithm so only rsh command lines get quoted values

cmr=v1.8.2:reviewer=jsquyres