Fix a NULL pointer dereference during shutdown

Signed-off-by: Florian Forster <octo@collectd.org>