Fix a bug, improve and speed up pgsql RA

I considered this comments.
https://github.com/t-matsuo/resource-agents/commit/d744b0e79f0083476e98bbc100e1c3e461f7fa44

ref : https://github.com/ClusterLabs/resource-agents/pull/266