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