Fix #679: fix occasional exceptions at shutdown when collecting dispatch...

...er objects