BSD compatibility improvements by being POSIX compliant.
Can't make assumptions of the pthread_t type, so don't use arithmetic on
it. On platforms where pthread_t is not a scalar type, we can't use
CRYPTO_THREADID_set_numeric. We have to use CRYPTO_THREADID_set_pointer.
So instead of clobbering the file with #ifdef's, remove the
CRYPTO_THREADID_set_callback() alltogether and let openssl use the
default implementation.
Only seed once on program initialization instead of each new thread.
We don't care much if threads interrupt the random sequence meant for
other threads. Use the posix version of random() instead of rand() and
getcwd() instead of the GNU specific get_current_dir_name().