Namespace uri_templates caching by base_href.

The uri_templates cache inside of resources was operating in a way that it was
global to the resource within any given server thread. This meant that if the
resource is namespaced in the URL (say, with Review Board's local sites), it
would sometimes return bad data. This change makes it namespace the cache using
the base_href, so there are effectively separate caches for each local site.

Testing done:
Wrote a unit test for this in reviewboard/webapi/tests.py

Reviewed at http://reviews.reviewboard.org/r/4107/