Encode strings to UTF-8 before sending them to LDAP.

According to the RFCs that I quickly browsed through, it looks like LDAP
expects text to be encoded as UTF-8. This typically doesn't matter because most
strings that we deal with for authentication are ASCII.

In bug 2978, a user had an accent in their password, which meant they couldn't
authenticate. This is easily fixed by encoding the strings first.

Testing done: Ran unit tests.

Fixes bug 2978.

Reviewed at https://reviews.reviewboard.org/r/5272/
Hand-check unique_together constraints with null values.

Django has a bug where unique_together constraints for foreign keys aren't
enforced properly when one of the foreign keys is null (well, technically it's
a database bug). This meant that users who weren't using local sites could
create Groups or Repositories that had conflicting names and paths.

This change implements the `clean()` method for the Group and Repository
models. This method is automatically called from ModelForms, which means the
admin site is fixed automatically.

The web API has a similar issue, but only for repositories. The Group
create/update methods had an implementation which already checked for these
sorts of problems. I haven't implemented a unit test for the repository API
changes because this change is currently on 1.7.x, but I'll add it to the to-do
list for master.

Testing done:
* Tried to create a Group with a conflicting name from the admin UI.
* Tried to create a Repository with a conflicting path from the admin UI.
* Tried to create a Repository with a conflicting name from the admin UI.
* Tried to create a Repository with a conflicting path from the web API.
* Tried to create a Repository with a conflicting name from the web API.
* Ran unit tests.

Fixes bugs 3066, 3093.

Reviewed at https://reviews.reviewboard.org/r/5274/
Merge branch 'release-1.7.x'
Clean up reviews/urls.py.

This cleans up reviews/urls.py by separating out rules with common
prefixes into urlpatterns that can be included.

There are still some prefixes that remain across rules within a
urlpatterns block (the review e-mail previews), but those seemed to make
more sense kept together.
Provide raw downloading of files in the diff viewer.

The diff viewer now shows a download icon next to the revision
information for each file, allowing the original or new versions of a
file to be downloaded. This also works with files on interdiffs.

This can be used for easily downloading a patched file at any stage of a
diff revision range, or generating a diff based on the original and
modified files outside of Review Board.

Binary files use this as well instead of the previous "Download" links.
The existing actions lists remain, but won't be shown unless there's
content on either side. That can happen if there's a "Review" or
"New Comment" link.