Fix an HTTP 500 error when user registration fails.

A backport of some code to the 0.7.x releases resulted in user
registration failures being handled incorrectly. This was just due to a
couple missing imports. These have now been added, and old unused
imports have been removed.
Release Djblets 0.7.28.
Specify TRACKING_BRANCH in release-0.7.x's .reviewboardrc
Merge branch 'release-0.7.x'
Include query parameters in API pagination links.

The 'next' and 'previous' links for pagination were stripping out any query
parameters which had been passed into the list resource, which effectively
broke them (since the results would probably be different). This change adds
all of the query parameters into the returned URLs.

Testing done:
Fetched the review-request-list resource using some query parameters and saw
that the pagination links included the same ones that I passed in and that the
only things that changed were 'start' and 'max-results'.

Fixes bug 3199.

Reviewed at https://reviews.reviewboard.org/r/5344/
Merge branch 'release-0.7.x'
Safely shut down extension hooks.

It was possible to trigger shutting down an extension twice, which could
easily break hooks. Hooks assume they'll be initialized once and shut
down once, but this would break if extensions ever called shutdown on
themselves.

We now check an initialization state on the hook just to be sure before
we do any shutdown work.

Extensions wishing to shut down the hooks should now call
shutdown_hooks() instead of shutdown().