Use psql --command instead of parsing stdout

I think that executing a simple query that returns either '1' or '' is a bit simpler than grep-ing though stdout to determine if a role/database exists. 

I was also having occasional failures with both database_check and user_check whilst testing ec2 deployments. So far using queries has seemed more reliable