Use intern() instead of _get_cached_ascii for getting unique revision_ids and file_ids.
intern() puts the strings in a dict (similar to what we do), but it does so without increasing the refcount, so intern()ed strings do not have unlimited lifetime. This allows us to avoid duplicate copies in memory, without having an unlimited cache. Further, we avoid keeping a Unicode representation of the string around, as we no longer use unicode revision_ids or file_ids in the codebase.