Fixed connection leakage in pgsql.