Improved connection handling in riemann client