Stop leaking internal library pointers in error messages.

Requested by miod@
Improve RAND_write_file(), chmod crud, etc.
ok tedu
whitespace
Fix memory leak upon error in ssl_parse_clienthello_use_srtp_ext().
From BoringSSL.
not needed anymore
added handler for an atfork hook from kettenis@

ok deraadt@ beck@ kettenis@
#ifdef wrap the _rs_forkhandler
do not need a variable to track locking, since all code paths have it
locked throughout.
Only call getauxval(3) if HAVE_GETAUXVAL is defined.  Fixes build on older
Linux (such as Ubuntu 12.04LTS) that don't have it yet.  Seems the AT_XXX
defines are pulled in by <link.h> now.

ok beck@
Fix tlsext_tick_lifetime_hint value in test #2 to make sure the
(tlsext_tick_lifetime_hint > 0) test also passes on 32-bit platforms
(tlsext_tick_lifetime_hint is a long).
Free sktmp when it's no longer needed. By doing so, we fix a bunch of memory leaks.

From miod@

OK from miod@ and guenther@
Missing bounds check in ssl3_get_certificate_request(), was not spotted in
1.78; reported by Ilja Van Sprundel.
"Race-free because we're running single-threaded in a new
address space, and once allocated rs is never deallocated."
document the forkhandler to save reviewers time, with matthew
it is 2014, and we still need to encourage people away from srand()
and random().  Sigh.
avoid sys/param.h; Jonas Termansen
avoid errx(); Jonas Termansen
Seperate arc4random's os-dependent parts into static inline functions,
making it much easier for libressl -portable to fill in the gaps.
ok bcook beck
Change lsearch()'s "base" argument to require a non-const pointer to
align with POSIX and other systems.

Pointed out by Elliott Hughes on tech
ok deraadt
zap trailing whitespace;
Remove "const" from the lsearch(3) manual's synopsis too.

Reminded by Rafael Neves