Try hard to get PYTHONPATH right for subprocesses.

This sets PYTHONPATH in two places, in an attempt to get it right for
all cases where we invoke subprocesses.

Newly generated reviewboard.wsgi files will have PYTHONPATH explicitly
set to include the conf directory.

We also set PYTHONPATH in initialize to that of sys.path, which should
ensure that, at least after the first URL access, we have all the
modules Review Board has access to available to the subprocess.

Fixes bug #2834
Update to Django 1.3.7.

This is the latest security release. Most of the issues shouldn't affect
us, but better safe than sorry.
Brand new user sees "None" for all dashboard counts in a local site.

Fix the Starred Public Review Count for new user

The CounterField initializer for starred_public_request_count was calculating
the count as 0 if the pk of that table was not null. The parantheses for this
calculation was not setup properly , which caused the value to be setup as None
for the first time user.

Also fixed a test which was assuming that the first time user will see None for
the counts. With this and the associated djblets fix, this isnt true anymore.
This fixes the reviewboard side of things and is associated to the review
request 3841 (which is a djblets fix).

Testing done: Manual testing with localsites and regular ones. Ran all
reviewboard tests.

Fixes bug 2873.
Reviewed at http://reviews.reviewboard.org/r/3842/
Fix a crash when the right-side diff doesn't have a header.

There was an error when parsing a diff where there were headers on the
left-hand side but not the right-hand side. The solution was found by
Ze Lin Xiao at NetApp.

Fixes bug #2876
Strip whitespace from STMP server names.

The STMP server configuration would fail if there was trailing whitespace on the
server name. This was a problem when copy/pasting text into the form.

Testing done:
Produced the bug with an smtp server "smtp.gmail.com     " and triggered an
email event (registration for new user). Log produced an error: "Unknown host".
Added the changes on the diff and tried again, the email is sent and the value
that is saved is stripped of the redudant spaces.

Reviewed at http://reviews.reviewboard.org/r/3759/
Fixes bug 2620.
Fix a regression with displaying diff viewer file entries.

The "Files Changed" list in the diff viewer broke with Windows-style
paths. A previous change was made to fix a JavaScript injection issue,
but that caused some escaping issues when using backslashes. We now
escape both HTML and JavaScript.
Undo the ALLOWED_HOSTS change.

This slipped in when I was testing, and just breaks things. Get rid of it.
Release Review Board 1.6.16.
Merge branch 'release-1.6.x'