Make pkinit's crypto init code MT safe.

pkinit plugin calls various OpenSSL initialization functions, that
are not MT safe. These functions are supposed to be called once only,
but there is a race in the code allowing multile threads to start
invoking the code simultanously.

This fix serializes initialization and finalization routines.