Avoid calling kyua_result_write with a NULL format

gcc complains if we pass NULL to a printf-like format string even if
that's perfectly fine in our code.  To workaround this issue, split
kyua_result_write into kyua_result_write_with_reason so that we can
pass or not the message only when it's not NULL.
Fix build with gcc on FreeBSD 11.0-CURRENT ppc64

Remove a template qualifier from a method call that was confusing the
gcc compiler (4.2.1) in FreeBSD 11.0-CURRENT under powerpc64.