Properly closing HTTP requests on errors in iterator.