Fix a bug, improve and speed up pgsql RA

I considered this comments too.
https://github.com/ClusterLabs/resource-agents/pull/269

And I add a new simple commit (5697a43).