Filter error log statements by sqlstate

Allow the default log_min_error_statement to be overridden per sqlstate to
make it possible to filter out some error types while maintaining a low
log_min_error_statement or enable logging for some error types when the
default is to not log anything.

(cherry picked from commit 61fe332f35f49c59257e9dcd0b5e2ff80f1f4055)