Pass the extension instance to SignalHook-registered signal callbacks.

When using SignalHook, the callback will now be passed an extension
instance as a keyword argument, making it easier to operate on the
extension or access settings without having to fetch the instance.

Due to the changes being made here, I've also changed sandbox behavior
so that we always log the error, even if we're not sandboxing.

Reviewed at https://reviews.reviewboard.org/r/6602/
Refactor the alphabetic paginator changes into new AlphanumericDatagrid subclass.

This changes the implementation of the alphabetic paginator to be a subclass of
the Datagrid (AlphanumericDatagrid). The paginator(s) are no longer rendered
using template tags, but instead a render_paginator function, which uses
settings that are overloaded by the alphanumericDataGrid.

Testing Done:
- Unit tests all pass
- All button cases manually tested. (Forward, back, first and last arrows, each
  letter).
- Verified that  changes to not affect any other module that inherits from
  datagrid (such as the groups list, or the all review requests list, the
  current 'master' of reviewboard with no changes to the userGrid).

Bugs closed: 829

Reviewed at https://reviews.reviewboard.org/r/6521/
Attempt to fix DynamicURLResolver with threads.

We had some occasional bugs where Django would fail to look up items
from URL resolvers, generating a HTTP 500. This is likely due to a
lookup occurring while the cache is being cleared.

This change attempts to improve the way we handle clearing of caches.
Instead of wiping the entries and expecting Django's URLResolvers to
rebuild them when appropriate, we now directly call their _repopulate()
method. This method will generate new copies of the dictionaries and
then immediately set them, without leaving any time where the
dictionaries would be empty.

This should ensure that a valid lookup will always succeed, without any
risk of the types of failures we've seen.

It also surrounds this in a lock, hopefully preventing any clashes
during the repopulation process.

Reviewed at https://reviews.reviewboard.org/r/6606/
Release Djblets 0.8.13.
Merge tag 'release-0.8.13' into release-0.8.x
Fix thread safety issues with the forwarding cache backend.

The forwarding cache backend had a thread safety problem where a thread
would be resetting the cache while another was attempting to access it,
resulting in the access being performed on a None value. This is a
problem because in Django, a cache backend is shared across all threads.

A couple things were done to improve the thread safety.

First, we no longer reset the backend to None. Instead, we replace the
old backend with a new one. Accesses to the old backend may still occur
without completely breaking.

Second, we reduce the chance of such collisions by preventing several
threads from reloading the backend at the same time. We now keep a
generation number for the cache backend. When we go to load a new
backend, the thread will locally store the last seen generation number
and then attempt to grab a lock.

Whichever thread acquires that lock first will set the new backend and
then update the generation number. Subsequent threads that grab the lock
will check their local copy of the old generation number against the
stored one, and use that to decide whether to load the backend.

Reviewed at https://reviews.reviewboard.org/r/6644/
Make RelationCounterField's rel_field_name default to None.

This allows django-evolution to add, change, and remove instances of
RelationCounterField.

Reviewed at https://reviews.reviewboard.org/r/6642/
Fix a newline error.