blobmsg_json: simplify add_separator and fix thread-safety