Clean up Apache and Nginx integration tests.

- Make the tests as language-independent as possible so that the same set
  of tests can be run for each supported language.
- Fix some brittlenesses in the tests.
- Begin getting rid of the dependency on Rails 2.
Fix newly discovered ApplicationPool bugs which could cause queued requests not to be processed when they should be, or which could cause too many processes to be spawned.