Fix avahi threading issues correctly