Fix 'interdiff-revision' field name in the diff context resource.

When I added this resource, I copied the field names that are used for POST/PUT
operations (which use underscores), rather than those in GET operations (which
use hyphens). This worked from the web UI (where we assemble the URL directly),
but caused problems when using the RBTools API (which transforms all
underscores into hyphens for GET requests). This change fixes that field name
to be 'interdiff-revision'.

Testing done:
Verified that diff and interdiff selection still worked properly using the new
URL parameters.

Reviewed at https://reviews.reviewboard.org/r/6292/
Remove deprecation warning during cron job.

Change crontab entry to use clearsessions in favour of cleanup as cleanup has
been deprecated.

Testing Done:
Running `./reviewboard/manage.py cleanup` causes warning messages to be
outputted, but running `./reviewboard/manage.py clearsessions` does not.

Bugs closed: 3535

Reviewed at https://reviews.reviewboard.org/r/6300/
Fix usage of timedelta.total_seconds() in condensediffs.

The `total_seconds()` method doesn't exist in Python 2.6, so we can't use it
yet. This change replaces it with the equivalent implementation (and moves us
over to using true division throughout this file as a side effect).

Testing done:
Condensed some diffs.

Reviewed at https://reviews.reviewboard.org/r/6304/
Allow local_site_reverse to take an actual LocalSite.

local_site_reverse was able to take a LocalSite's name, or a request
object, but if you actually had a LocalSite (or None), you'd have to
write your own conditional to extract the name and pass it.

Now, local_site_reverse can take a LocalSite. This saves a database
query, if one is already available, and simplifies calling code.

Reviewed at https://reviews.reviewboard.org/r/6302/
Fix Local Site and validation issues with post-commit hooks.

The post-commit hook support in hosting services had a few issues that
could lead to unintentionally closing the wrong review requests on
other repositories. They also weren't compatible with Local Sites.

The URL for the hook identified the repository, and the URL also
contained the hosting service ID, but we wouldn't use either to properly
validate the repositories. That meant that if a hook was set up to point
to repository 1 on GitHub, and then had a commit referencing a review
request on repository 2 on Bitbucket, things would break.

We now capture the hosting service ID and pass it, the local site name,
and the repository ID to the function that handles closing review
requests. That function will then use that information to narrow down
the list of repositories being processed, in order to avoid operating on
some other review request. The function has also been rewritten to
minimize the number of SQL queries needed.

Local Sites were broken because nothing bothered to check for them. The
URLs were added to the root urlpatterns, and not to
localsite_urlpatterns. There was some code that did something weird with
trying to get a Local Site from a resolved URL, but that didn't really
do anything. Now everything is wired up to allow for hooks on Local
Sites and to restrict operations to review requests on the Local Site.

There's a few other changes here and there to help consistency and to
minimize code. For instance, we had different error responses for
invalid payloads, and they weren't really correct. We just use HTTP 400
now.

Unit tests were added for the three services that support post-commit
hooks. They test hooks with and without Local Sites, and test invalid
repository IDs, Local Site names, and service IDs.

The unit test for testing service registration was also split up into
several tests, since it was testing several things.

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