pk11_RSA_finish() is called when OpenSSL PKCS#11 engine is turned on and RSA_free() is called. pk11_RSA_finish(RSA *rsa) should delete key material (and all references to it in the engine) associated with the 'rsa' stucture. It not only does not do that properly (see CR 6602801) but it was written so that it removes all RSA keys from PKCS#11 engine free list.
Instead, it should just remove the key material referenced by its argument.
The same is valid for pk11_DH_finish() and pk11_DSA_finish().