Added a wrap_database_exception context manager and decorator.

It re-throws backend-specific exceptions using Django's common wrappers.
Wrapped database exceptions in the base backend.

This covers the most common PEP-249 APIs:
- Connection APIs: close(), commit(), rollback(), cursor()
- Cursor APIs: callproc(), close(), execute(), executemany(),
  fetchone(), fetchmany(), fetchall(), nextset().

Fixed #19920.
Removed redundant exception wrapping.

This is now taken care of by the cursor wrapper.
Improved API for wrapping database errors.

Thanks Alex Gaynor for the proposal.
Added PEP 3134 exception chaining.

Thanks Jacob Kaplan-Moss for the suggestion.
Fixed #15901 -- Wrapped all PEP-249 exceptions.