avoid malloc in the writev path if in signal handler
Fix two X509 certificate leaks.