Portal closed error

We weren't properly keeping track of whether we were in a transaction or
not. This meant that some queries that should have been run in a
transaction were run in autocommit mode and so any that suspended a
portal had the portal immediately closed, because a portal
can only exist within a transaction.

This has been solved by determining the transaction status from the
READY_FOR_QUERY message.