tcp-socket: Fix duplicate close completion after tcp_socket_close()

After a call to tcp_socket_close(), the connection must be considered as closed
and reported as such to the event callback only once uip_closed() has confirmed
the actual closure, and not also right after uip_close() has been invoked.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
http-socket: Close connection upon response completion or time-out

The Connection general-header field is used to signal that the connection will
be closed after completion of the response, but http-socket relied on the server
to close the connection. This change forcibly closes the connection on the
client side as soon as the response is known to have completed (thanks to the
Content-Length entity-header field), or after a response time-out.

This client closure is also useful to overcome bad RF links that may lose some
TCP packets, especially FIN. Hence, this fixes possible response deadlocks.
Closing connections are also easier to manage than persistent connections
because of that.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>