Issue 7846:  fnmatch cache can grow without bound

Updated to solution to use the functools.lru_cache().
Restores the API so that purge() is not needed
(because the cache never gets big).
3 files changed