WIP: Call CRYPTO_set_locking_callback

So that we actually get some thread safety.

The cross platform locking stuff is based on the PyPy code and is entirely untested on Windows. This does fix the crash in my test case described in #330 on Linux.