pgsql: Tune reconnect logic, fixes a few problems. Reapply all supplied runtime parameters afer a reconnect. This does not work for search_path (yet) because of an omission in PostgreSQL.