Fixed the threading issue with AVAHI