Fix segfault in connect_destroy()

Fixed #147