Fixed #19253 -- Extracted template cache key building logic

Introduced a public function
django.core.cache.utils.make_template_fragment_key
Thanks @chrismedrela for fruitful cooperation.