ssl-proxies: Refactor ResourceSecurityWrapperStore

Simplifies and optimizes the code and fixes potential race conditions.
ssl-proxies: Fix races in PEMKeyStore