Fix several compile issues with clang for BSD/Mac

Now compiles with clang++ on FreeBSD other than an apparently spurious assertion failure.
Execution seems to almost work but DTLS handshake completion gives segmentation fault
by OpenSSL (in SSL_connect() calling EVP_MD_CTX_cleanup()).