Fix wrong lock claimed in x509 dir lookup.
Fix wrong lock claimed in x509 dir lookup.

x509 store's objects cache can get corrupted when using dir lookup
method in multithreaded application. Claim x509 store's lock when
accessing objects cache.

CLA: trivial

Reviewed-by: Richard Levitte <5fb523282dd7956571c80524edc2dccfa0bd8234@openssl.org>
Reviewed-by: Tomas Mraz <973cc78d8b4cb00714230ba9be0225e917ab4ac6@fedoraproject.org>
Reviewed-by: Bernd Edlinger <ac6902843ae77cc0d49b9c8ddec4cbf141db1bb7@hotmail.de>
Reviewed-by: Paul Dale <bc4a6b4cd7a8395c734c8eb5aef04a9c30188c85@oracle.com>
Reviewed-by: Shane Lontis <452ce16516ceed26291fe7de3f8b53540d83864e@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9326)

openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl