(PUP-19708) Make the puppet agent retry failed requests.

The puppet agent may receive an error response or encounter a
network timeout while making a request from the puppet master.
When this occurs, the puppet agent fails to process the associated
resource.  With this change, in the case of idempotent requests
(such as HTTP GET or HEAD), the puppet agent tries requests up to
3 times, with a sleep after each failed request.