Added explicit termination of sockets.

Signed-off-by: Filippsen <maiconfilippsen@gmail.com>
Remove std::cerr and unused checks on destructor
Fix comment typo
Add assertions on pointer dereference