network: Respond to messages before closing connections

This makes a connection tell the actor to stop the connection, instead
of stopping it itself. This is preferable, because other messages sent
to the actor that is not processed yet, may now send data to the client.

E.g. it makes this work:
$ echo status | nc localhost 6600
Merge pull request #722 from trygveaa/develop

network: Respond to messages before closing connections