Fixes another event handler leak.

It turns out 'error' handlers were leaking as well, although more slowly.