fixes double free crash on GLProgramStateCache
Merge pull request #6664 from ricardoquesada/fix_double_free_crash

fixes double free crash on GLProgramStateCache