net: tcp: Close the connection unconditionally on forced close

The current approach was buggy, for example the TCP context could be
unrefed twice in case of forced close. Or in case of a race, when the
application closed the socket first, the TCP context wouldn't be
dereferenced at all.

Calling the tcp_conn_close() unconditionally in case of forced close
solves all those issues.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1 file changed