Add connection attempt limit

Add a connect() function that connects
to the ssh server, if this fails it
does a retry algorithm until that fails
and then the thread dies.

If that works, consume from the given client
and if that fails, allow for retrying using
a new client (after a given consume_retry_delay
delay).

To maintain previous behavior the default of
attempting to connect forever is provided when the
number of connection_attempts is <= 0.

Change-Id: I1a2cb764c7cef04b8137a7e4b05d9a4cc45498b0
Merge "Add connection attempt limit"