[DBAL-717] Fix bug in MasterSlaveConnection with keepSlave option and switch back after transaction.

Conflicts:
	tests/Doctrine/Tests/DBAL/Functional/MasterSlaveConnectionTest.php
Merge pull request #690 from adrienbrault/dbal-717-2.4

Cherry pick to 2.4: [DBAL-717] Fix bug in MasterSlaveConnection with keepSlave option and switch back after transaction.