[fix] don't return the 'connect' emit in case there is a callback and ensure the socket is closed before emitting close on the client