The fact that both solutions shared some code like Lukasa said, and the fact that both results were equivalent whenever querying Apache or Tomcat made me first think it was related to the Python code. But in fact it was related to the servers configurations.
The trick is that both Apache and Tomcat share a setting which indicates how many HTTP requests can be made within the same TCP connection. And both have a default value of 100.
Tomcat:
maxKeepAliveRequests:
The maximum number of HTTP requests which can be pipelined until the connection is closed by the server.
If not specified, this attribute is set to 100.
See http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Standard_Implementation
Apache:
MaxKeepAliveRequests:
The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is on
Default: MaxKeepAliveRequests 100
See http://httpd.apache.org/docs/2.2/en/mod/core.html#maxkeepaliverequests
By modifying these values only a very few connections can be created indeed