Reset backup_idx when necessary

backup_idx is incremented for each attempt, but if we run out of nodes
to connect to, future connection attempts will fail unless we set this
number properly.

Change-Id: I20125aeda81f5b468e580ef9034a422347f52545
Reviewed-on: http://review.couchbase.org/29986
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>