Problem: older 4.1 libzmq's return nonsense for ZMQ_SOCKET_LIMIT

Solution: cut socket limit to 64K if it's larger. Otherwise using
it in zmq_ctx_set (ZMQ_MAX_SOCKETS) will exhaust process memory and
cause stupid things to happen.
Merge pull request #520 from mvala/master

Initialize priority
Merge pull request #521 from hintjens/master

Problem: older 4.1 libzmq's return nonsense for ZMQ_SOCKET_LIMIT
Regenerated zgossip from latest zproto
Merge pull request #522 from sappo/master

re-generated zgossip_engine.h from latest zproto
Fix 'forcing int to bool'.
Add missing zgossip dynamic lib exports.
Merge pull request #523 from evoskuil/master

Add missing dynamic lib export, fix warning.
Problem: zsys deadlocked at exit, if ZSOCK_NOCHECK was defined

The code in zsys_close was wrong; it did not close sockets when the
macro was defined (due to sockets not being tracked). This led to a
shutdown deadlock in libzmq (due to 1 or more sockets remaining open).

Solution: when ZSOCK_NOCHECK is defined, do not attempt to use list
of tracked sockets in zsys_close. Always close socket. Second, if there
are sockets remaining open, log an error but don't call zmq_term().
Merge pull request #525 from hintjens/master

Problem: zsys deadlocked at exit, if ZSOCK_NOCHECK was defined
Fixing minor bug with getting curve key from socket options
Merge pull request #526 from kedrzu/master

Fixing minor bug with getting curve key from socket options
Problem: was passing wrong size to zmq_getsockopt on keys

libzmq requires receiving buffer to be exactly 32, or 41 bytes
for a binary or Z85 key respectively. CZMQ was passing a 255
byte buffer, and then ignoring the EINVAL return code. This was
caught by the new --with-militant assert checking (yay!)

Solution: pass a 41 byte buffer as required by the zmq_getsockopt
man page.
Problem: did not build until CZMQ was already installed

The generated zgossip_msg class assumed czmq.h was in /usr/local/include
which is correct for all applications except CZMQ itself. Zproto now
checks for czmq.h in ../include, and uses that if possible, else uses
the file in /usr/local/include/czmq.h.
Updated man pages
Regenerated zgossip server engine
Merge pull request #528 from hintjens/master

Problem: was passing wrong size to zmq_getsockopt on keys
Problem: need way to capture log data in any binding

Solution: allow zsys to send log data to a PUB socket. zsys_logsender
defines an endpoint that log data will be sent to. This can also be
set by the ZSYS_LOGSENDER environment variable.
Merge pull request #529 from hintjens/master

Problem: need way to capture log data in any binding
Problem: unreliable dependency on libsodium

CZMQ doesn't need libsodium, as all relevant calls are wrapped in the
zmq_util layer. Furthermore, detecting and using libsodium in CZMQ is
fragile as it is too easy to build libzmq and CZMQ inconsistently.

Additionally, the previous approach assumed CZMQ would be rebuilt if
there was a change to libzmq.

Solution: remove all dependencies on libsodium. Use zsys_has_curve()
to detect and report whether libzmq was built with libsodium or not.
This lets us switch CURVE on/off dynamically by installing different
builds of libzmq.