blobmsg: simplify and fix name length checks in blobmsg_check_name