Add a simple call of abort() when the write fails in the signal handler.