Normalize the hooks_uuid field before saving the repository.

The hooks_uuid field would become a blank string after editing in the
admin UI. This resulted in a collision as soon as there was more than
one entry with a blank string.

We now normalize this to None if blank prior to saving.

Reviewed at https://reviews.reviewboard.org/r/6362/
Bullet-proof pre-commit UI a bit.

When receiving an unexpected error from the server, the frontend code for the
pre-commit upload would hit a TypeError, preventing it from completing the
process and leaving the browser with a forever "Loading..." message. This
change updates it to check when the response can't be parsed as JSON and show
"Unknown error" instead.

While I was in here I fixed up some of the nearby localization to be more
correct.

Testing done:
- Checked that uploading a diff through the pre-commit UI still worked as
  expected.
- Ran js-tests.

Reviewed at https://reviews.reviewboard.org/r/6365/
Fix the handling of binary data when reading in diff files in javascript.

Our drop-in replacement for File.readAsBinaryString wasn't entirely drop-in, in
that if it encountered any bytes > 127, it would fail with an
InvalidCharacterError, which would get translated into a fake ajax error that
said "HTTP 0" (which I don't have to tell you is completely useless). The
problem here was that we were using Int8Array instead of Uint8Array to convert
each byte into a String.

Testing done:
Made a diff that added a BOM to a utf-8 file. Tried to upload that diff and got
the same mysterious HTTP errors that appeared before any HTTP request got made.
After this change, the diff uploads correctly and I can see the added BOM in
the diff viewer.

Reviewed at https://reviews.reviewboard.org/r/6364/

Fixes bug 3579.