rake:db:test:prepare falls back to original environment after execution.
Merge pull request #10424 from markevich/fix_test_prepare

Restore ActiveRecord connection to original environment after rake:db:test:prepare task.