Fixed 19949 -- Cached template loader now caches TemplateDoesNotExist

Thanks @timgraham and @jdunck for the code reviews and Kronuz for bug
report and initial patch.