[ncp-uart] fix the bug in uart encoder (#2145)
[ncp-uart] fix the bug in uart encoder (#2145)

This commit fixes an issue with the `NcpUart::EncodeAndSendToUart()`
code where the last message can be removed from `mTxFrameBuffer`
and if we ran out of buffer and cannot finalize the HDLC encoded
frame, the final bytes would not be sent until next message is
queued in `mTxBuffer`.
georgecpr/openthread,abtink/openthread,xiaom-GitHub/openthread,fbsder/openthread,vaas-krish/openthread,bukepo/openthread,srickardti/openthread,openthread/openthread,fbsder/openthread,mszczodrak/openthread,pvanhorn/openthread,pvanhorn/openthread,pvanhorn/openthread,bukepo/openthread,chshu/openthread,chshu/openthread,mszczodrak/openthread,erja-gp/openthread,chshu/openthread,fbsder/openthread,chshu/openthread,jwhui/openthread,pvanhorn/openthread,librasungirl/openthread,mszczodrak/openthread,gandreello/openthread,fbsder/openthread,aeliot/openthread,abtink/openthread,LeZhang2016/openthread,lanyuwen/openthread,georgecpr/openthread,librasungirl/openthread,lanyuwen/openthread,lanyuwen/openthread,srickardti/openthread,vaas-krish/openthread,gandreello/openthread,fbsder/openthread,LeZhang2016/openthread,vaas-krish/openthread,lanyuwen/openthread,bukepo/openthread,turon/openthread,chshu/openthread,erja-gp/openthread,turon/openthread,chshu/openthread,mszczodrak/openthread,librasungirl/openthread,gandreello/openthread,pvanhorn/openthread,aeliot/openthread,gandreello/openthread,fbsder/openthread,mszczodrak/openthread,turon/openthread,gandreello/openthread,georgecpr/openthread,lanyuwen/openthread,xiaom-GitHub/openthread,lanyuwen/openthread,georgecpr/openthread,xiaom-GitHub/openthread,aeliot/openthread,erja-gp/openthread,LeZhang2016/openthread,mszczodrak/openthread,librasungirl/openthread,erja-gp/openthread,aeliot/openthread,aeliot/openthread,vaas-krish/openthread,aeliot/openthread,georgecpr/openthread,xiaom-GitHub/openthread,openthread/openthread,abtink/openthread,bukepo/openthread,jwhui/openthread,openthread/openthread,LeZhang2016/openthread,LeZhang2016/openthread,LeZhang2016/openthread,srickardti/openthread,gandreello/openthread,pvanhorn/openthread,jwhui/openthread,turon/openthread,vaas-krish/openthread,xiaom-GitHub/openthread,erja-gp/openthread,georgecpr/openthread,jwhui/openthread,openthread/openthread,srickardti/openthread,abtink/openthread,xiaom-GitHub/openthread,erja-gp/openthread,vaas-krish/openthread