use mosquitto_loop_start/stop for thread safe