write_kafka: avoid unused function build error

Noticed this problem when building with `-Werror`.