But afaict there's no problem with using pqParseInput3() and PQexecFinish() even if the message isn't handled as part of the transaction. Some other messages that pqParseInput3 handles which are not part of the transaction are 'N' (Notice) and 'K' (secret key).
I have to recheck it
here is new version based on usage of PQexecFinish