Added possibility to avoid closing a socket upon calling the dtor.