Make sure messages are not dispatched to dead actors and resources are cleaned up
inside the dispatcher.
Added to the previous commit.