check request length before forwarding to worker
Add gateway_timeout option and close timed-out requests

The Prefork service was observed allocating memory slowly
for several weeks until it swapped and crashed. Some of the
requests_* arrays were found to be growing unbounded. This
patch cleans up after requests that can no longer return a
response to the agent.