[cppmyth] TcpSocket: write accessors inline
[cppmyth] Fix crash when trying disconnect

Start the disconnection procedure only for valid socket.