fix recreating old environment when connections are closed in a slave block
fix recreating old environment when connections are closed in a slave block

test plan:
 * Run ActiveRecord::Base::ConnectionSpecification.with_environment(
    :slave) {
    ActiveRecord::Base.connection_handler.clear_all_connections! }
 * ActiveRecord::Base.connection_handler should not be nil

Change-Id: I6f0721eb00c3fd6d9ac27ad73d9ddf8fd768c512
Reviewed-on: https://gerrit.instructure.com/14139
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
Reviewed-by: Jacob Fugal <f862f167b85d41b225785c70d70808bc7337c1fe@instructure.com>

wrdsb/canvas-lms,arrivu/hoodemo,efrj/canvas-lms,sfu/canvas-lms,gbleydon/canvas-lms,arrivu/arrivu-lms,Unow/ins,sli7246/canvas_branch,dgynn/canvas-lms,redconfetti/canvas-lms,leftplusrightllc/canvas-lms,arrivu/hoodemo,leftplusrightllc/canvas-lms,samuels410/greatlakes-lms,venturehive/canvas-lms,matematikk-mooc/canvas-lms,arrivu/jigsaw-lms,juoni/canvas-lms,utkarshx/canvas-lms,loganrun/pincan,arrivu/jigsaw-lms,redconfetti/canvas-lms,arrivu/qibla-ecampus,Unow/canvas-lms,rup/Tarrax,dgynn/canvas-lms,arrivu/jigsaw-lms,matematikk-mooc/canvas-lms,usmschuck/canvas,fronteerio/canvas-lms,whalejasmine/canvas-lms,skmezanul/canvas-lms,parbros/red-innovadores-lms,grahamb/canvas-lms,kyroskoh/canvas-lms,tgroshon/canvas-lms,arrivu/qibla-ecampus,efrj/canvas-lms,instructure/canvas-lms,merichar/canvas-lms,sfu/canvas-lms,narigone/canvas,usmschuck/canvas,eCNAP/CANVAS,instructure/canvas-lms,instructure/canvas-lms,landonwilkins/canvas-lms,Unow/canvas-lms,HotChalk/canvas-lms,merichar/canvas-lms,arrivu/hiring-site,Jyaasa/canvas-lms,shidao-fm/canvas-lms,AndranikMarkosyan/lms,samuels410/greatlakes-lms,greyhwndz/canvas-lms,nditech/red-innovadores-lms,fronteerio/canvas-lms,nditech/red-innovadores-lms,sdeleon28/canvas-lms,wimemx/Canvas,arrivu/hoodemo,narigone/canvas,wimemx/Canvas,instructure/canvas-lms,roxolan/canvas-lms,jay3126/canvas-lms,samuels410/greatlakes-lms,snehakachroo1/LSI_replica,nditech/red-innovadores-lms,SwinburneOnline/canvas-lms,leftplusrightllc/canvas-lms,narigone/canvas,ShreniiNepal/shrenii_lmp,kyroskoh/canvas-lms,shidao-fm/canvas-lms,gbleydon/canvas-lms,greyhwndz/canvas-lms,rup/Tarrax,sdeleon28/canvas-lms,ShreniiNepal/shrenii_lmp,greyhwndz/canvas-lms,snehakachroo1/LSI_replica,grahamb/canvas-lms,landonwilkins/canvas-lms,Unow/canvas-lms,antoniuslin/canvas-lms,sdeleon28/canvas-lms,Rvor/canvas-lms,arrivu/qibla-ecampus,utkarshx/canvas-lms,arrivu/arrivu-lms,wrdsb/canvas-lms,jay3126/canvas-lms,Rvor/canvas-lms,roxolan/canvas-lms,leftplusrightllc/canvas-lms,juoni/canvas-lms,rup/Tarrax,sfu/canvas-lms,AndranikMarkosyan/lms,antoniuslin/canvas-lms,samuels410/greatlakes-lms,jay3126/canvas-lms,loganrun/pincan,efrj/canvas-lms,va7map/canvas-lms,landonwilkins/canvas-lms,parbros/red-innovadores-lms,parbros/red-innovadores-lms,Rvor/canvas-lms,ShreniiNepal/shrenii_lmp,wimemx/Canvas,wye0220/shindig-canvas,va7map/canvas-lms,va7map/canvas-lms,shidao-fm/canvas-lms,Unow/ins,wrdsb/canvas-lms,usmschuck/canvas,SwinburneOnline/canvas-lms,venturehive/canvas-lms,va7map/canvas-lms,HotChalk/canvas-lms,matematikk-mooc/canvas-lms,whalejasmine/canvas-lms,shidao-fm/canvas-lms,Jyaasa/canvas-lms,wrdsb/canvas-lms,sfu/canvas-lms,loganrun/pincan,ShreniiNepal/shrenii_lmp,instructure/canvas-lms,SwinburneOnline/canvas-lms,sli7246/canvas_branch,antoniuslin/canvas-lms,venturehive/canvas-lms,sdeleon28/canvas-lms,Jyaasa/canvas-lms,sfu/canvas-lms,Rvor/canvas-lms,dgynn/canvas-lms,djbender/canvas-lms,grahamb/canvas-lms,antoniuslin/canvas-lms,juoni/canvas-lms,roxolan/canvas-lms,sfu/canvas-lms,grahamb/canvas-lms,skmezanul/canvas-lms,redconfetti/canvas-lms,jay3126/canvas-lms,eCNAP/CANVAS,Unow/ins,fronteerio/canvas-lms,juoni/canvas-lms,landonwilkins/canvas-lms,eCNAP/CANVAS,djbender/canvas-lms,arrivu/hiring-site,kyroskoh/canvas-lms,skmezanul/canvas-lms,narigone/canvas,wye0220/shindig-canvas,kyroskoh/canvas-lms,snehakachroo1/LSI_replica,efrj/canvas-lms,wye0220/shindig-canvas,arrivu/arrivu-lms,merichar/canvas-lms,dgynn/canvas-lms,HotChalk/canvas-lms,whalejasmine/canvas-lms,whalejasmine/canvas-lms,djbender/canvas-lms,gbleydon/canvas-lms,sli7246/canvas_branch,snehakachroo1/LSI_replica,instructure/canvas-lms,utkarshx/canvas-lms,grahamb/canvas-lms,tgroshon/canvas-lms,roxolan/canvas-lms,matematikk-mooc/canvas-lms,tgroshon/canvas-lms,instructure/canvas-lms,nditech/red-innovadores-lms,skmezanul/canvas-lms,Jyaasa/canvas-lms,utkarshx/canvas-lms,greyhwndz/canvas-lms,AndranikMarkosyan/lms,HotChalk/canvas-lms,redconfetti/canvas-lms,sfu/canvas-lms,djbender/canvas-lms,tgroshon/canvas-lms,fronteerio/canvas-lms,SwinburneOnline/canvas-lms,arrivu/hiring-site,AndranikMarkosyan/lms,venturehive/canvas-lms,usmschuck/canvas,eCNAP/CANVAS