make error handling possible

This PR makes it possible to install an error handler on a DNode server or client, as follows:

```perl
my $d = DNode->new({ ... });
$d->on->{error} = sub {
  my ($msg) = @_;
};
```

This makes it possible to handle error events, which means (for example) that the server will not die when a client unexpectedly disconnects.