CRM-16036 - Fix for chaining.
When using a custom field as param for the API, chaining
didn't work as it should. This is a fix.
I have a unit test for this as well, but it depends on a fix for
CRM-16168, so if I add it here, it will break anyway.
I will document this in the issue itself.
----------------------------------------
* CRM-16036: API: searching on custom fields does not work
https://issues.civicrm.org/jira/browse/CRM-16036
* CRM-16168: Chained call event-loc block returns an error if no loc block exists.
https://issues.civicrm.org/jira/browse/CRM-16168