Store a PGresult in the Exception error

This makes the Diagnostics independent from further operations on the cursor
and allows using it with exceptions not generated by a cursor.
Added tests to verify the new Diagnostics properties

diag can be used on exceptions raised without cursor and is independent from
the cursor.

Docs updated to reflect the changes.
psycopg2.Error object and type renamed more consistently