crypto/provider_core.c: correct definition and use of lock