Clean the cache if it isn't a valid json object

Sometimes it isn't valid json for some reason... probably json.dump is
dropping in a 'This is not a valid json' error into the file instead.  I
haven't been able to catch one in the process yet.

There should still be an error catch here anyway
Merge pull request #12872 from gtmanfred/cache

Clean the cache if it isn't a valid json object