Add support for C-function's error-result.

We need to first land the change in opendylan for this to work.