pkcs15-init: fix memory corruption