pkcs11: Rewrite APDU handling in transmitAPDU