Error when aurora cluster instance failover
`is_closed()` refers to internal state of Peewee, not the underlying psycopg2/libpq connection. Psycopg2 does not really expose a good way to check the state, see this comment for some background explanation: https://github.com/coleifer/peewee/issues/2654#issuecomment-1325199936 - also note that handling failover by silently reconnecting may not be a good idea, as any uncommitted changes prior to the reconnect could be lost.

My suggestion is to decide where, in your application, it makes the most sense to handle these kinds of events - and code defensively (catching the `InterfaceError` possibly, although I would have expected one slightly different error **before** the `InterfaceError` occurs -- typically an OperationalError).
Hi,

I'm using PostgresqlDatabase to manage my Aurora DB.
I've encountered the following error after the the AZ on which the writer instance went down and caused a failover.
```
Traceback (most recent call last):
  File "/Users/schmil/work/oxeye-cloud/data_pipeline/sink_instance_creator/sink_instance_persistant_storage.py", line 72, in _handle
    query.execute()
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 1911, in inner
    return method(self, database, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 1982, in execute
    return self._execute(database)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2761, in _execute
    return super(Insert, self)._execute(database)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2477, in _execute
    cursor = self.execute_returning(database)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2484, in execute_returning
    cursor = database.execute(self)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3173, in execute
    return self.execute_sql(sql, params, commit=commit)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3167, in execute_sql
    self.commit()
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2933, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3158, in execute_sql
    cursor = self.cursor(commit)
  File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3145, in cursor
    return self._state.conn.cursor()
peewee.InterfaceError: connection already closed
```
I managed to reproduce it and when checked the connection before executing the query using `is_closed()` it returned false but still got the error

I'm using a single connection without connection pool because I have only a single thread
How can configure peewee to handle failovers?