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

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