Re-fixed #19949. Added extra test.

The extra test checks that the "missing.html" has been cached after
the template loader fails to load that missing template.