Fix overzealous file existance caching.

File existence check caching had a flaw where, if a file didn't exist,
we'd cache that it didn't exist, but if it was later pushed and then did
exist, we'd still think it didn't.

We now only cache when it exists. If it doesn't, we don't cache, and
will check again the next time get_file_exists is called.
Add a unit test for API root caching.

This adds a unit test to make sure that caching of uri_templates in the API root
takes into account the correct local site.

Testing done:
Ran all tests.
Before the djblets change, the new test failed. After, it succeeds.

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