Added counters for unsuccessful requests and io exceptions.

Hi @deflaux,

I removed the refresh token call from our code to use utils-java code again. After running it for an hour it refreshed the token correctly, while also handling IO errors correctly.

Thanks!