Fix lack of retry when curl error code encountered