Fix trace segfault for non-daemon functions (RHBZ#682756).
Previously we expanded the code for 'trace_return' unconditionally for
all non-daemon functions. However this code was not prepared to
handle all error conditions, and in fact would segfault if it tried to
print RStringList or RHashtable where r == NULL.
We need to make the code conditional on the return value, calling
either 'trace_return' or 'trace_return_error' as appropriate.
Note the difficult case for RConstOptString which returns NULL in
non-error cases.