Problem: process hangs on exit if there are open sockets

Old issue with libzmq shutdown that cannot handle open sockets. The
correct strategy for an application is to correctly call zsock_destroy
on all sockets before exiting. When the app does not do that, we want
to detect it and warn the user, and not call zmq_ctx_term() stupidly.

Solution: count number of open sockets in zsys and if non-zero, do not
call zmq_ctx_term() in exit handler.
zdir now resistant to all file types

A directory full of symlink caused a zlist full of NULL. When the comparison
hook was called, no check was performed on the pointer's validity. Now it
doesn't segfault.
zlist now doesn't accept NULL items.

NULL seems to have a special meaning (e.g. end of list), so it is useless
and misleading to store it.
Merge pull request #481 from jfsmig/JFS-zdir-20140518

zdir now resistant to all file types
Merge pull request #482 from jfsmig/JFS-zlist-20140518

zlist now doesn't accept NULL items.
Merge pull request #480 from hintjens/master

Problem: process hangs on exit if there are open sockets
Problem: pipe endpoints were badly generated

Random number overflow caused systematic duplicates.
Solution is to stick to 4-byte values and use two of them.
Bunch of fixes to make zactor/zsock work better

- moved signal handling from zctx to zsys
- interrupt flag is now called zsys_interrupted
- zctx_interrupted is deprecated
- zsys_handler_set/reset methods are removed
- zsys internal methods are explicitly marked in API
- zsock now tracks sockets to allow leak detection
- un-destroyed sockets are reported and then destroyed
- zsock_wait/signal take void * arguments including zactor_t
- zsock_wait filters & discards non-signal messages
Merge pull request #483 from hintjens/master

Improvements to support zactor/zsock
Fixed memory leak in socket leak detection

Thanks, valgrind. zsys wasn't freeing the sockrefs when
destroying sockets via application calls.
Merge pull request #484 from hintjens/master

Fixed memory leak in socket leak detection