Separated out duplicate QoS flag code into new mqtt_sn_get_qos_flag() function