CRM-13426 fix - Fatal error on search that includes a smart group created by custom group

http://issues.civicrm.org/jira/browse/CRM-13426
Merge pull request #1718 from monishdeb/CRM-13426

CRM-13426 fix - Fatal error on search that includes a smart group created by custom search