CRM-15156 -  Clear cms resource cache during upgrade (resubmit)

Resubmit #3949 with work-around for hard test-crash