Catch socket.error EPIPE when sending notifications