Use block form of PGconn to ensure closing of connection

I was testing this plugin and found that it left unclosed DB connections on each run. This was especially bad when using the live monitor mode.

Switching to the block form of the connection ensures that the connection is dropped at completion or if an exception occurs.

The test requires a refactoring that is a bit beyond me, and so it's currently failing with this pull. I'm hoping that I can get some assistance with that if this is an agreed upon change