Fixed #22317 -- Fixed documented handler400 default value
Fixed #21239 -- Maintained atomicity when closing the connection.
Fixed #22321 -- Wrapped exceptions in _set_autocommit.

Refs #21202.
Fixed #21202 -- Maintained atomicity when the server disconnects.

Thanks intgr for the report.

This commit doesn't include a test because I don't know how to emulate a
database disconnection in a cross-database compatible way.