net: tcp: Do not mark TCP segment not sent in net_if
net: tcp: Do not mark TCP segment not sent in net_if

If the TCP segment is not sent properly by L2, then do not mark
it "not sent" in net_if.c:net_if_tx(). That "not sent" marking
confused TCP ref counting in tcp.c:tcp_retry_expired() and caused
the packet to be freed too early which then caused free net_buf
access issue during packet resend. This free memory access was
seen with zperf sample application.

From TCP point of view, the packet can be considered sent when
it is given to L2. The TCP timer will resend the packet if needed.

Fixes #15050

Signed-off-by: Jukka Rissanen <f9f077d1da4c7aa947f9864fa5a28c3588f6a45d@linux.intel.com>

finikorg/zephyr,galak/zephyr,finikorg/zephyr,ldts/zephyr,nashif/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,Vudentz/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,Vudentz/zephyr,ldts/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,Vudentz/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,Vudentz/zephyr,ldts/zephyr,nashif/zephyr,finikorg/zephyr