Add support for PostgreSQL 9.2 and later

Account for column name changes in pg_stat_activity.  The old names are
also still supported.
pep8 cleanup