Replaced pthread and simple_poll with AvahiThreadedPoll