Add CRYPTO_ONCE for subsequent use in self-init

Next up: make the direct users of the locking and threadid callbacks use
this for initialization.
Begin using the ONCE stuff for THREADID
Make use of the CRYPTO_ONCE facility for THREADID
Use CRYPTO_ONCE in rand_lib.c
Best effort fork-safety in default RNG

OpenSSL library functions are generally not async-signal-safe.  There's
little point trying to make them async-signal-safe.  But there may be
apps which use OpenSSL, fork(), then continue using OpenSSL on the child
side of the fork without problems.  This patch tries to re-seed the RNG
on first use in the child just in case there is such an app.

We might want to also do this at a higher layer (i.e., in rand_lib.c
instead of md_rand.c).
RAND_poll() immediately after selecting a def RNG
Self-initialize lock callbacks (except dynlocks)

TODO:

 - do the same for dynlocks
 - consider rw locks (SRW on Windows, rwlocks on POSIX) instead of
   exclusive locks
Make dynlocks callbacks self-initialize
EXCLUDE THIS COMMIT: makefiles