Do not attempt to PQclear a null PQresult*

See also #2175 for the 2.2 branch