initial underpinnings for mingw/cross compilation support

 Use canonical host rather than target so that this works:
 CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32

 Conditionally compile Linux issetugid compatibility function

ok beck@
update to newly-refactored arc4random compatibility shims

the thread-private bits can move next

ok beck@