Fix request retrying and error handling.

There were two problems with request handling:

1. I've seen situations where curl_exec() returns false but curl_errno() returns 0. Error handling was performed only when $errno was something else than 0. This means that false is returned, and PHP's SoapClient complains about __doRequest() not returning a string.

Fix this by checking both $errno and $response for erroneous values.

2. Request retrying was not working properly because if $attempt had not yet reached the persistance factor, the code would simply break out of the for loop on the first error.

Fix this by only breaking out of the loop if we got a valid response.