catch OSError (base of ConnectionError) and asyncpg errors for terminate
Fixed regression in the asyncpg dialect caused by :ticket:`10717` in
release 2.0.24 where the change that now attempts to gracefully close the
asyncpg connection before terminating would not fall back to
``terminate()`` for other potential connection-related exceptions other
than a timeout error, not taking into account cases where the graceful
``.close()`` attempt fails for other reasons such as connection errors.
Fixes: #10863
Change-Id: If1791bce26803f92547cdf26fb641996c7f638fa
(cherry picked from commit
eff3aa8ad6bf74181280a85bf03d401126c65b01)