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