Make send_stanza threadsafe