Add support for application_name filter on long running transactions and
long idle in transaction.

Good for filtering applications like pg_dump, but also others without
having to run them with a specific user.
Better check for insufficient privileges and configuration options
that haven't been set and are needed.