Merge pull request #100 from hintjens/master

Problem: zmq_ctx_term has insane behavior by default
Problem: issue #1273, protocol downgrade attack

Solution: backport fix from libzmq master. Also backported test
cases.