tcp: ctl: implement is_connected request

 To implement this we have to know the state of the socket.
As such a function is not provided by standard socket API,
we can get the socket information about TCP by using getsockopt()
with TCP_INFO even though that functionality depends on Linux
Kernel.