Place most of the RAND_* functions under #ifndef LIBRESSL_INTERNAL (some
are still needed for the engine). Our code should use arc4random instead.
Avoid a NULL pointer dereference that can be triggered by
SSL3_RT_HANDSHAKE replays.

Reported by Markus Stenberg <markus.stenberg at iki.fi> - thanks!

ok deraadt@
In PKCS12_setup_mac(), do not assign p12->mac->salt->length until the allocation
of p12->mac->salt->data has actually succeeded.
In one of my trees for a long time already...