Problem: issue #1273, protocol downgrade attack

Solution: backport fix from libzmq master. Also backported test
cases.
Merge pull request #101 from hintjens/master

Problem: issue #1273, protocol downgrade attack