client: add some basic error detection and rate limiting
We retry on error and we adjust to the X-RateLimit header the server
send us. This is quite basic, and has to struggle against the async
implementation of the request.
So further works should probably refactor the concurrency of the request
implementation before going further.
See inline documentation for details.
Better handling of ClientConnectionError are also needed.