Return an error when trying to POST a diff on a review request with no repository

The diff-list API didn't check that the associated ReviewRequest had a
repository before it started trying to parse things and validate the uploaded
data. This meant that trying to add a diff (likely via rbtools) to an
attachments-only review request would cause an exception on the server.

I've added a test for this, and fixed the bug. While I was trying to decide on
the right WebAPIError to use, I noticed an ugly misalignment in errors.py, so
I've fixed that too.

Testing done: Ran unit tests.

Fixes bug 3258.

Reviewed at https://reviews.reviewboard.org/r/5522/
Fix order of checks in git diff parsing.

One of our old review requests was causing an exception where it was indexing
past the end of the diff. The issue here is that we added code to check for
new file/moved file/mode change state, but that code was added above the index
check instead of below it.

Testing done:
Loaded the review request that was causing the error. Before this change, it
caused an exception. After, it loads fine.

Reviewed at https://reviews.reviewboard.org/r/5523/
Fix unicode handling in git diff parsing.

We still had some lingering type problems distinguishing between unicode and
bytes in parsing git diffs. This meant that diffs that including utf-8
characters would cause UnicodeDecodeErrors when type coercion tried to
interpret utf-8 encoded text as ascii. One example of this is the diff attached
to /r/3749/.

This change makes sure that during the diff parse, we're always treating the
text as bytes. While this is theoretically bad for non-utf8 encodings, it's no
worse than we've always had, and makes it so we can actually parse these diffs.

Testing done:
Loaded /r/3749/. Saw the page instead of a traceback. Verified that the raw
diff returned the right utf-8 encoded patch.

Reviewed at https://reviews.reviewboard.org/r/5524/
Fix changedesc captions field for screenshot objects.

The new captions code for changedescs was trying to access a 'filename'
property on Screenshot objects, but they didn't define such a property. This
change adds it.

Testing done:
Viewed /r/822/ from r.rb.o and saw a usable page with a change description that
included the caption, rather than a traceback.

Reviewed at https://reviews.reviewboard.org/r/5525/
Merge branch 'release-2.0.x'