connection: fix wrong inheritance way

It shares some objects with instances. util.inherits() is the best way
to inherit.