Silence deprecated warnings when compiling on Mac OSX.

Majority of functions in /usr/include/openssl/crypto.h are marked as
deprecated for Mac OSX 10.7 and later. Silence warnings.
Initialize OpenSSL with callback functions for threadlocking.

This makes OpenSSL threadsafe, and allows us to remove locking around the
calls to the RSA encryption functions in cf-serverd's AuthenticationDialogue.
Implements #2678

Note: the functions used - as well as most other functions used from
OpenSSL - are marked as deprecated on Mac OSX 10.7 and later.
Compiler warnings explicitly disabled. Functions documented in OpenSSL
documentation (http://www.openssl.org/docs/crypto/threads.html) to replace
some of these functions (such as CRYPTO_THREADID_set_callback) are not
available. This implementation follows the example provided on
http://www.opensource.apple.com/source/OpenSSL/OpenSSL-10/openssl/crypto/threads/mttest.c
With OpenSSL initialized to be made thread-safe, we don't have to serialize
access to the OpenSSL functions anymore.

Some other things were protected here by the cft_system locking:

- the ServerConnectionState *conn

This structure is initialized in the main thread, and then passed to the
thread handler, which takes exclusive ownership. No access to this object
from other threads is possible or allowed.

- malloc calls

Those are implicily threadsafe on all supported platforms today
Exclude callbacks that make OpenSSL threadsafe if we don't have pthread.
Don't de-initialize OpenSSL from function called via signal handler.

Threads are still running and might call OpenSSL functions. Removing the
callbacks etc leads to segfaults.

This leaves a memory leak at shutdown.
Don't register a thread-ID callback on Windows.

pthread_t on MinGW32 is a struct, and long is not large enough to hold the void*
within.

OpenSSL documentation states: If the application does not register such a callback
using CRYPTO_THREADID_set_callback(), then a default implementation is used - on
Windows and BeOS this uses the system's default thread identifying APIs

So not setting this callback at all will be safe.