remove dead code and unnecessary call to pkcs_C_GetAttributeValue

(cherry picked from commit 2e4986e2)
39 jobs for !1929 with 984-remove-dead-code-in-pkcs11-keygen-c-v9_14 in 12 minutes and 52 seconds (queued for 3 seconds)
merge request