#3270 Database connection to return the read PDO connection if in transaction

This is a proposed fixed for #3270.

`getReadPdo()` now checks if the query is within a transaction, and in that case returns the same PDO connection as the write.