ConnectionPool::urlopen(): Closing opened connections in case of error

If there's an error occur during operation, urlopen() function doesn't
close connection properly.

In my current project, I'm using the timeout and retry feature
frequently,  so a single request can be timed-out and retried as many as
20 times.
The number of requests can go up to more than 100,000, and it leads to
crash in open SSL (libcrypto.so.1.0.0.0 segment fault or double free
memory, etc.), assumingly due to the excessive number of sockets
remaining open.

After applying the modification to package code, I could get rid of such
crashes, and my project code runs stable now.