Curl return code handling