Fix for ongoing issues with static upsetting the apple cart
This is an alternate to https://github.com/civicrm/civicrm-core/pull/18218
I managed to replicate the bug in https://issues.civicrm.org/jira/browse/CRM-4213 that the static
was added to cover. This takes an alternate approach of loading the memberships & checking them
rather than a static. I think it might mean more queries but they shouldn't be expensive queries & the
code is just too hard-going to skip straight from hacked but still intermittantly buggy to also having no additional
queries