refactor the brokerlink connect() code

- so it actually ends after a few attempts to connect
- throw a proper exception when the attempts are exhausted

Change-Id: I8875c0a19d61c5331a27c11bfa762177dd6a335b
Signed-off-by: Jiri Moskovcak <jmoskovc@redhat.com>