fix MQTT_LF_LENGTH implementation
optimize mqtt_buffer_write_string, use bit macros