[thirdparty] handle OpenSSL errors properly in curl and squeasel

This patch improves handling of OpenSSL errors in squeasel and curl,
making the code more robust.

This patch addresses the flakiness in the newly added JWT tests
that were failing in DEBUG-enabled builds because of the assertions
triggered by the SCOPED_OPENSSL_NO_PENDING_ERRORS macro.

I'm planning to submit the patches to the CURL project upstream and
post a PR to the squeasel repo [1] correspondingly.  To expedite the
fix and avoid too many unrelated test failures for every CR submitted
to the upstream gerrit, it makes sense to just patch the current source
of these two thirdparty components as an interim solution.

[1] https://github.com/cloudera/squeasel

Change-Id: I209ceb35ded66222c90b82e98e7d191f33573217
Reviewed-on: http://gerrit.cloudera.org:8080/19849
Tested-by: Kudu Jenkins
Reviewed-by: Zoltan Chovan <zchovan@cloudera.com>
Reviewed-by: Abhishek Chennaka <achennaka@cloudera.com>
3 files changed