[PATCH 2/5] pem: Add pem_write_certificate_chain