ar/connection_pool: honor overriden rack.test in middleware

Honoring an overidden `rack.test` allows testing closed connection between
multiple requests. This is useful if you're working on database resiliency, to
ensure the connection is in the expected state from one request to another on
the same worker.
Merge pull request #17020 from Sirupsen/ar-override-rack-test

activerecord/connection_pool: honor overidden rack.test in tests