Fix half-closed TCP connection if peer closed first, see #3185

This allows to send data back to the peer even if the peer already has sent EOF/FIN as specified for TCP. To fully close a connection, the handler now has to close its side of the connection actively when it is finished with writing even if it received a `PeerClosed` message before.

One thing that should be discussed is if it should be mandatory that a connection has to be actively closed from the other side after a `PeerClosed` was received (and consequentially if `PeerClosed` should derive from `ConnectionClosed`) or if there should be a timeout that automatically fully closes the connection some time after the peer closed the connection and something was last sent to the peer (I've got a commit which would add this timeout). The question is then how to configure the timeout, globally or per connection.