[3-2-stable] Fix GH #5399. connection_pools's keys are ActiveRecord::Base::ConnectionSpecification objects.