core: use Connection#getPeerAddress() to log failed writes

as Context#getAddress() on closed connections returns null

Acked-by: Paul Millar
Target: master