Added killing of threads when closing connection, isOpen property.