Fixed removal of signal receivers in Python 3.4

Make use of `weakref.finalize` and `weakref.WeakMethod` on python 3.4.
Simplified the removal of receivers, the old function looked overly
complicated.

Many thanks go to Antoine Pitrou for helping me to debug and explain all
the failures I ran into while writing that patch.
Fixed a test isolation issue. Refs #17062.

This test could change settings.DATABASES['default']['TIME_ZONE'] and
didn't restore the previous value.
Fixed #21452 -- Non-autocommit connections to PostgreSQL.

When settings.DATABASES['default']['AUTOCOMMIT'] = False, the connection
wasn't in autocommit mode but Django pretended it was.

Thanks Anssi for analysing this issue.

Refs #17062.
Added license info for the weakref backports
Merge pull request #2163 from apollo13/signals

Signals
Fixed flake8 issues.
Fixed #21453 -- Enabled autocommit before calling init_connection_state.

Also ensured the transaction state is clean on Oracle while I was there.

This change cannot be backported to 1.6 because it's
backwards-incompatible for custom database backends.
Restored a test broken by overzealous PEP8 cleanup
Fixed a test that was failing with PostGIS.

Fixed #21452 again.

Forward-port of 18d75e07 from stable/1.6.x.
Used a regular lock for app registry population.

Since the app registry is always populated before the first request is
processed, the situation described in #18251 for the old app cache
cannot happen any more.

Refs #18251, #21628.
Fixed #21477 -- Renamed db to using in pre/post_migrate signals.
Fixed #21770 -- Updated autocomplete for app-loading.

Thanks dfunckt for the report.