CRM-15343 fix - 4.5.0 corrupts soft references to case-types

https://issues.civicrm.org/jira/browse/CRM-15343
PREPARE + EXECUTE + DEALLOCATE => That's a neat trick.