reduce garbage creation in calculatePendingRanges

patch by dbrosius reviewed by bwilliams for cassandra-7191
cqlsh should return a non-zero error code if a query fails

patch by Branden Visser and Mikhail Stepura; reviewed by Mikhail Stepura for CASSANDRA-6344
only query once for local host id on join

patch by dbrosius reviewed by jbellis for cassandra-7257