fixed reconnection (#88) and added a max reconnection attempts configuration

fixes #88 
Usage:
```
OptionsBuilder<DefaultOptions, DefaultOptionsBuilder> clientOptions = client.newOptionsBuilder()
    .reconnect(true)
     .reconnectAttempts(10)
    .pauseBeforeReconnectInSeconds(5);

connection = client.create(clientOptions.build());
```