Fixed segfault in libavahi-client on SIGHUP [CORGI-12834]

Backported change from upstream version 2.2.5.