Add failing test reproducing issue #1015.

There is a race condition when connect and bind on a new inproc
endpoint happen "simultaneously" in threads.  Causes the error:
  Assertion failed: ok (ctx.cpp:474)

This is a backport of libzmq:5cf74db6b
by Joe Eli McIlvain <joe.eli.mac@gmail.com>
Fix race condition in connecting inproc sockets

This is a backport of libzmq:3678c32b9
by Martin Hurton <hurtonm@gmail.com>
Merge pull request #81 from olafmandel/issue_1015

Backport of test and fix for zeromq/libzmq#1015