Don't allow exceptions escape from postgresql_statement_backend dtor.

This fixes abnormal program termination if an error happened while executing a
prepared statement: it was then destroyed during stack unwinding and if
deallocating it failed as well, resulting in a call to terminate().

In practice, deallocation seems to always fail with SQL state 25P02 ("current
transaction is aborted, commands ignored until end of transaction block") when
it is executed inside a transaction.
Merge pull request #134 from vadz/pg-terminate-fix

Don't allow exceptions escape from postgresql_statement_backend dtor.
Streamline error handling in PostgreSQL backend with postgresql_result.

Make sure all PGresults are always correctly deallocated by wrapping them in
RAII postgresql_result class and simplify the error handling code by
integrating it into this class as well instead of copying the same code in
multiple places.

The only user-visible change is that postgresql_soci_error is now thrown even
if the connection to the server is completely lost, while a simple soci_error
was thrown before in this case.