agent: fix tpm2d keytotpm handling
* agent/divert-tpm2.c (agent_write_tpm2_shadow_key): Call agent_delete_key before agent_write_private_key. Recover from an error.
Cherry-picked from master commit of:
eda3997b439e415f1bebaa3be20c8bdb43d3a1d0
- Fixes-commit: a1015bf2fc07dabb1200eab5fa41f13e7bf98202
- Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>