The deferred action for statement free or close operations (including closing of leaked statements) should notify errors to the database instance so it can terminate the connection for fatal errors.
The handling of deferred actions should be overhauled to ensure this is always done, instead of delegating this to the creators of a deferred action.