attribute: Add error handling to riemann_attribute_create()

In riemann_attribute_create(), check the return values of
riemann_attribute_set_key() and riemann_attribute_set_value(), and if
they return an error, propagate them. Also, only call these when the key
and value arguments are non-NULL.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
event: Deinit a varargs variable

In _riemann_event_set_va(), call va_end() on the copied varargs at the
end of the successful branch too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
message: Move a pointer dereference after NULL checks

In _riemann_message_combine_events(), move the dereference of n_events
to after the NULL checks. Although all callers call it with a non-NULL
pointer, there is a NULL check, so move the dereference after it, to be
on the safe side.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>