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