Fix a crash during avahi agent shutdown.