This patch refactors all of the connection state PQfinish() and NULL’ing into a single function.
Excludes PQfinish() in doConnect().
This came out of earlier ppoll() work where this was felt to be worthwhile but not directly relevant to that change.
doug