**Describe the bug**
nanomq版本0.21.8
当我使用sqlite进行retain消息持久化时
sqlite {
    disk_cache_size = 102400
    mounted_file_path = "/usr/local/etc/"
    flush_mem_threshold = 100
    resend_interval = 5000
}
因为场景需要，我在编译时修改系统主题可以保留retain 0->1

原代码

`
#define DISCONNECT_TOPIC "$SYS/brokers/disconnected"

#define CONNECT_TOPIC "$SYS/brokers/connected"

nng_msg *
nano_msg_notify_connect(conn_param *cparam, uint8_t code)
{
	nni_msg *   msg = NULL;
	mqtt_string string, topic;
	char        buff[512];

	snprintf(buff, 256, CONNECT_MSG, cparam->username.body,
	    nni_timestamp(), cparam->pro_name.body, cparam->keepalive_mqtt,
	    code, cparam->pro_ver, cparam->clientid.body, cparam->clean_start, cparam->ip_addr_v4);
	string.body = buff;
	string.len  = strlen(string.body);
	topic.body  = CONNECT_TOPIC;
	topic.len   = strlen(CONNECT_TOPIC);
	msg         = nano_pubmsg_composer(
            &msg, 0, 0, &string, &topic, cparam->pro_ver, nng_clock());
	return msg;
}
`

改为

`
	msg         = nano_pubmsg_composer(
            &msg, 1, 0, &string, &topic, cparam->pro_ver, nng_clock());
`

当客户端连接并订阅主题$SYS/#时，会报错
2024-05-09 12:28:36 [18506] INFO  /home/econe/dev/nanomq/nanomq/bridge.c:1024 bridge_tcp_connect_cb: Bridge client subscribed topic /node/ad345be3b320d/# (qos 1 rap 0 rh 0).
2024-05-09 12:28:36 [18507] INFO  /home/econe/dev/nanomq/nanomq/bridge.c:285 send_callback: bridge: subscribe aio result 0
2024-05-09 12:28:36 [18507] INFO  /home/econe/dev/nanomq/nanomq/bridge.c:287 send_callback: bridge: suback code 1
2024-05-09 12:28:41 [18498] INFO  /home/econe/dev/nanomq/nanomq/sub_handler.c:86 decode_sub_msg: topic: [/#] len: [2] pid [7120]
2024-05-09 12:28:41 [18507] INFO  /home/econe/dev/nanomq/nanomq/sub_handler.c:86 decode_sub_msg: topic: [$SYS/#] len: [6] pid [7121]
2024-05-09 12:28:41 [18502] WARN  /home/econe/dev/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:639 tcptran_pipe_recv_cb: nni aio recv error!! Connection shutdown

2024-05-09 12:28:41 [18502] WARN  /home/econe/dev/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:907 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: parse error rv: 139

2024-05-09 12:28:41 [18498] WARN  /home/econe/dev/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:397 nano_ctx_send: pipe id 1288900292 is gone, pub failed


我只是想取得某个客户端的最后状态是连接还是断开，比如
$SYS/brokers/emqx@172.17.0.8/connection
{"status": "disconnected/connected"}

retain消息持久化，系统主题有bug
This is a GitHub Issue
repo:nanomq
owner:emqx
Title : retain消息持久化，系统主题有bug
Issue date:

--- start body ---
**Describe the bug**
nanomq版本0.21.8
当我使用sqlite进行retain消息持久化时
sqlite {
    disk_cache_size = 102400
    mounted_file_path = "/usr/local/etc/"
    flush_mem_threshold = 100
    resend_interval = 5000
}
因为场景需要，我在编译时修改系统主题可以保留retain 0->1

原代码

`
#define DISCONNECT_TOPIC "$SYS/brokers/disconnected"

#define CONNECT_TOPIC "$SYS/brokers/connected"

nng_msg *
nano_msg_notify_connect(conn_param *cparam, uint8_t code)
{
	nni_msg *   msg = NULL;
	mqtt_string string, topic;
	char        buff[512];

	snprintf(buff, 256, CONNECT_MSG, cparam->username.body,
	    nni_timestamp(), cparam->pro_name.body, cparam->keepalive_mqtt,
	    code, cparam->pro_ver, cparam->clientid.body, cparam->clean_start, cparam->ip_addr_v4);
	string.body = buff;
	string.len  = strlen(string.body);
	topic.body  = CONNECT_TOPIC;
	topic.len   = strlen(CONNECT_TOPIC);
	msg         = nano_pubmsg_composer(
            &msg, 0, 0, &string, &topic, cparam->pro_ver, nng_clock());
	return msg;
}
`

改为

`
	msg         = nano_pubmsg_composer(
            &msg, 1, 0, &string, &topic, cparam->pro_ver, nng_clock());
`

当客户端连接并订阅主题$SYS/#时，会报错
2024-05-09 12:28:36 [18506] INFO  /home/econe/dev/nanomq/nanomq/bridge.c:1024 bridge_tcp_connect_cb: Bridge client subscribed topic /node/ad345be3b320d/# (qos 1 rap 0 rh 0).
2024-05-09 12:28:36 [18507] INFO  /home/econe/dev/nanomq/nanomq/bridge.c:285 send_callback: bridge: subscribe aio result 0
2024-05-09 12:28:36 [18507] INFO  /home/econe/dev/nanomq/nanomq/bridge.c:287 send_callback: bridge: suback code 1
2024-05-09 12:28:41 [18498] INFO  /home/econe/dev/nanomq/nanomq/sub_handler.c:86 decode_sub_msg: topic: [/#] len: [2] pid [7120]
2024-05-09 12:28:41 [18507] INFO  /home/econe/dev/nanomq/nanomq/sub_handler.c:86 decode_sub_msg: topic: [$SYS/#] len: [6] pid [7121]
2024-05-09 12:28:41 [18502] WARN  /home/econe/dev/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:639 tcptran_pipe_recv_cb: nni aio recv error!! Connection shutdown

2024-05-09 12:28:41 [18502] WARN  /home/econe/dev/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:907 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: parse error rv: 139

2024-05-09 12:28:41 [18498] WARN  /home/econe/dev/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:397 nano_ctx_send: pipe id 1288900292 is gone, pub failed


我只是想取得某个客户端的最后状态是连接还是断开，比如
$SYS/brokers/emqx@172.17.0.8/connection
{"status": "disconnected/connected"}

--- end body ---
