Fix upgrading database settings.
Fix upgrading database settings.

We had two problems with the upgrade of database settings. The first was
that we never properly migrated postgresql backends to have the full
module path, which meant that we had a new-style DATABASES, but an
old-style engine value.

The second is that, starting in Django 1.4, the old-style engine names
are deprecated, and the settings file was cached prior to the settings
upgrade. So in both the above case and a move from an old version with
DATABASE_ENGINE, we ended up with the old values still in settings, and
that broke the upgrading.

We're now upgrading the postgresql setting, and we're also reloading the
settings so that we can use them during DB upgrade.

reviewboard/reviewboard,KnowNo/reviewboard,sgallagher/reviewboard,reviewboard/reviewboard,brennie/reviewboard,custode/reviewboard,beol/reviewboard,1tush/reviewboard,chipx86/reviewboard,davidt/reviewboard,chipx86/reviewboard,brennie/reviewboard,beol/reviewboard,custode/reviewboard,chipx86/reviewboard,custode/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,bkochendorfer/reviewboard,reviewboard/reviewboard,1tush/reviewboard,KnowNo/reviewboard,1tush/reviewboard,sgallagher/reviewboard,1tush/reviewboard,brennie/reviewboard,beol/reviewboard,davidt/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,sgallagher/reviewboard,KnowNo/reviewboard,chipx86/reviewboard,1tush/reviewboard,davidt/reviewboard,1tush/reviewboard,davidt/reviewboard,brennie/reviewboard,beol/reviewboard,reviewboard/reviewboard,bkochendorfer/reviewboard,1tush/reviewboard,custode/reviewboard,KnowNo/reviewboard,sgallagher/reviewboard