CRM-12321 - SQL/Memcache coherency

Add patches onto #1029