Improve error reporting, providing HINT, DETAIL and CONTEXT as separate entries.

The PostgreSQL protocol defines error fields with some precision, as can be
read at
http://www.postgresql.org/docs/current/static/protocol-error-fields.html.
This patch improves the database-error condition to expose important fields
separately and fixes get-error so that news fields are properly filled when
an error occurs.