crypto/tls: handle errors in generate_cert.go
crypto/tls: handle errors in generate_cert.go

I don't expect these to hit often, but we should still alert users if
we fail to write the correct data to the file, or fail to close it.

Change-Id: I33774e94108f7f18ed655ade8cca229b1993d4d2
Reviewed-on: https://go-review.googlesource.com/91456
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

Cofyc/go,Cofyc/go,codestation/go,josharian/go,golang/go,Cofyc/go,akutz/go,nawawi/go,codestation/go,golang/go,nawawi/go,codestation/go,akutz/go,josharian/go,josharian/go,codestation/go,nawawi/go,CAFxX/go,nawawi/go,Cofyc/go,cloudflare/go,CAFxX/go,Cofyc/go,cloudflare/go,akutz/go,akutz/go,CAFxX/go,cloudflare/go,akutz/go,nawawi/go,Cofyc/go,golang/go,josharian/go,CAFxX/go,nawawi/go,cloudflare/go,CAFxX/go,codestation/go,cloudflare/go,josharian/go,Cofyc/go,akutz/go,CAFxX/go,CAFxX/go,josharian/go,nawawi/go,golang/go,akutz/go,josharian/go,cloudflare/go,nawawi/go,codestation/go,golang/go,golang/go,codestation/go,codestation/go,josharian/go,akutz/go,CAFxX/go,cloudflare/go,golang/go,golang/go,Cofyc/go,cloudflare/go