Problem: very hard to debug security mechanism mismatch

E.g. when server is not configured, and client tries PLAIN security,
there is no hint of why this does not work.

Solution: add debugging output for this case. Note that the various
debugging outputs for security failures should probably be sent to
an inproc monitor of some kind.
Merge pull request #1280 from hintjens/master

Problem: very hard to debug security mechanism mismatch
Problem: need atomic reference counting in several projects

Solution: as libzmq already provides this across all platforms,
expose an atomic counter API. I've not wrapped atomic pointers,
though someone who needs this may want to do so.
Merge pull request #1281 from hintjens/master

Problem: need atomic reference counting in several projects
Problem: 'bool' is not defined by default

zmq_atomic_counter_dec returned a 'bool' value, yet this isn't
defined by standard, so causes compile errors in upstream code.

Solution: return an int that can be safely converted to bool if
needed by bindings.
Problem: test cases were sporadically failing

Solution: increase settle time for bind/unbind tests
Merge pull request #1282 from hintjens/master

Fixed atomic API, which used 'bool'