Fix compatibility with net-http-persistent v3.0
Fix compatibility with net-http-persistent v3.0

The net-http-persistent gem started using the connection_pool gem in
v3.0.0, which changed the behavior of Net::HTTP::Persistent#shutdown
(aka `self.http.shutdown` in Mechanize::HTTP::Agent).  The new behavior
raises a ConnectionPool::Error ("no connections are checked out") if a
request is made after `shutdown` has been invoked.

The main purpose of `shutdown` seems to be invoking `finish` on each of
the connections.  So my best guess as to a replacement for
`self.http.shutdown` was something like:

  self.http.connection_for(URI(uri)){|conn| self.http.finish(conn) }

However, looking through the code of both net-http-persistent v2.9.4 and
v3.0.0, it seems like `self.http.shutdown` may not have been necessary
in the first place.  Mechanize::HTTP::Agent#fetch calls
Net::HTTP::Persistent#request to do the heavy lifting.  In both v2.9.4
and v3.0.0, when Net::HTTP::Persistent#request rescues from an
Errno::ECONNRESET exception (the original cause of all this), it retries
only once and then calls Net::HTTP::Persistent#request_failed, which in
turn calls Net::HTTP::Persistent#finish with the connection.  Thus, it
seems the only necessary action is to retry more than once.

jonathanhefner/grubby