CRM-14676 - need to escape names before inserting into prev_next_cache

----------------------------------------
* CRM-14676: Inserting values into civicrm_prevnext_cache fails to properly escape names
  https://issues.civicrm.org/jira/browse/CRM-14676
Merge pull request #3235 from jmcclelland/escape-prev-next-cache

Escape prev next cache