Fix bugfix to segfault in `peer::dispose`

This patch is a followup for d78fe26 that didn't quite fix the bug.