Fix segfault in destructor of service manager.

Service manager stores raw pointers to all the managed connections. In destructor the manager disconnects all the connections. When some service and manager are destroyed simultaneously, it could happen that the service doesn't delete himself from the manager and the manager disconnects already deleted service. I have fixed it with weak_ptr!