CurlURLInputStream constructor: avoid memory leak

CurlURLInputStream constructor calls the readMore() method, which can
throw exceptions. In that situation, the destructor is not called, which
results in resource/memory leaks. To fix that, catch the exceptions,
manually do the cleanup and rethrow the exceptions.

Found by ossfuzz (locally)
2 files changed