Handle errors on the `pg_execute` function properly.

Before this patch executing `pg_execute` always returned the statement object,
even on failure. This patch fixes this so it matches the specification of this
function as defined here:

    http://php.net/manual/en/function.pg-execute.php

According to the README of this project, the `pg_execute` function should
behave in the same way as in the Zend implementation.