redis-cli: Factor out command sending functions

Now we can reliably connect to cluster instances in all contexts
instead of needing to copy/paste the big while(1) loop everywhere.

Bonus fix: this *also* enables automatic cluster redirection for
--pipe mode!

Fixes #2114