zmq test: fix flakiness by using more robust sync method
zmq test: fix flakiness by using more robust sync method

After connecting the subscriber sockets to the node, there is no
guarantee that the node's zmq publisher interfaces are ready yet, which
means that potentially the first expected notification messages could
get lost and the test fails. Currently this is handled by just waiting
for a short period of time (200ms), which works most of the time but is
still problematic, as in some rare cases the setup time takes much
longer, even in the range of multiple seconds.

The solution in this commit approaches the problem by using a more
robust method of syncing up, originally proposed by instagibbs:
    1. Generate a block on the node
    2. Try to receive a notification on all subscribers
    3. If all subscribers get a message within the timeout (1 second),
       we are done, otherwise repeat starting from step 1

domob1812/namecore,instagibbs/bitcoin,instagibbs/bitcoin,dscotese/bitcoin,rnicoll/bitcoin,JeremyRubin/bitcoin,domob1812/namecore,qtumproject/qtum,qtumproject/qtum,bitcoinknots/bitcoin,apoelstra/bitcoin,jamesob/bitcoin,jamesob/bitcoin,tecnovert/particl-core,jlopp/statoshi,pataquets/namecoin-core,qtumproject/qtum,AkioNak/bitcoin,kallewoof/bitcoin,namecoin/namecore,Sjors/bitcoin,andreaskern/bitcoin,ajtowns/bitcoin,andreaskern/bitcoin,achow101/bitcoin,bitcoin/bitcoin,jambolo/bitcoin,bitcoinsSG/bitcoin,namecoin/namecoin-core,qtumproject/qtum,namecoin/namecore,tecnovert/particl-core,tecnovert/particl-core,rnicoll/bitcoin,fujicoin/fujicoin,jamesob/bitcoin,andreaskern/bitcoin,bitcoinknots/bitcoin,tecnovert/particl-core,lateminer/bitcoin,yenliangl/bitcoin,ElementsProject/elements,JeremyRubin/bitcoin,namecoin/namecoin-core,n1bor/bitcoin,apoelstra/bitcoin,rnicoll/bitcoin,yenliangl/bitcoin,jlopp/statoshi,dscotese/bitcoin,mruddy/bitcoin,anditto/bitcoin,kallewoof/bitcoin,MarcoFalke/bitcoin,lateminer/bitcoin,kallewoof/bitcoin,domob1812/bitcoin,ElementsProject/elements,rnicoll/bitcoin,MarcoFalke/bitcoin,n1bor/bitcoin,GroestlCoin/GroestlCoin,n1bor/bitcoin,Xekyo/bitcoin,particl/particl-core,jambolo/bitcoin,AkioNak/bitcoin,fanquake/bitcoin,ElementsProject/elements,sstone/bitcoin,Xekyo/bitcoin,ajtowns/bitcoin,mruddy/bitcoin,pataquets/namecoin-core,GroestlCoin/GroestlCoin,bitcoin/bitcoin,bitcoin/bitcoin,mruddy/bitcoin,sstone/bitcoin,mruddy/bitcoin,MarcoFalke/bitcoin,domob1812/bitcoin,particl/particl-core,AkioNak/bitcoin,qtumproject/qtum,GroestlCoin/bitcoin,JeremyRubin/bitcoin,bitcoin/bitcoin,kallewoof/bitcoin,JeremyRubin/bitcoin,domob1812/namecore,jlopp/statoshi,namecoin/namecoin-core,anditto/bitcoin,jlopp/statoshi,AkioNak/bitcoin,dscotese/bitcoin,fujicoin/fujicoin,tecnovert/particl-core,fujicoin/fujicoin,jambolo/bitcoin,achow101/bitcoin,mruddy/bitcoin,sstone/bitcoin,JeremyRubin/bitcoin,MeshCollider/bitcoin,rnicoll/bitcoin,andreaskern/bitcoin,yenliangl/bitcoin,bitcoinknots/bitcoin,anditto/bitcoin,prusnak/bitcoin,particl/particl-core,GroestlCoin/GroestlCoin,bitcoinsSG/bitcoin,bitcoin/bitcoin,Sjors/bitcoin,ElementsProject/elements,ajtowns/bitcoin,Xekyo/bitcoin,lateminer/bitcoin,lateminer/bitcoin,jamesob/bitcoin,mm-s/bitcoin,MeshCollider/bitcoin,particl/particl-core,sipsorcery/bitcoin,fanquake/bitcoin,Sjors/bitcoin,sstone/bitcoin,prusnak/bitcoin,yenliangl/bitcoin,Xekyo/bitcoin,qtumproject/qtum,sipsorcery/bitcoin,lateminer/bitcoin,pataquets/namecoin-core,apoelstra/bitcoin,MeshCollider/bitcoin,lateminer/bitcoin,namecoin/namecoin-core,domob1812/bitcoin,sipsorcery/bitcoin,mm-s/bitcoin,pataquets/namecoin-core,instagibbs/bitcoin,bitcoinsSG/bitcoin,instagibbs/bitcoin,mm-s/bitcoin,fanquake/bitcoin,anditto/bitcoin,yenliangl/bitcoin,sstone/bitcoin,bitcoin/bitcoin,dscotese/bitcoin,namecoin/namecore,n1bor/bitcoin,namecoin/namecore,fanquake/bitcoin,kallewoof/bitcoin,domob1812/bitcoin,GroestlCoin/GroestlCoin,ajtowns/bitcoin,yenliangl/bitcoin,pataquets/namecoin-core,mm-s/bitcoin,kallewoof/bitcoin,GroestlCoin/bitcoin,prusnak/bitcoin,namecoin/namecoin-core,apoelstra/bitcoin,bitcoinsSG/bitcoin,bitcoinsSG/bitcoin,GroestlCoin/bitcoin,GroestlCoin/bitcoin,pataquets/namecoin-core,dscotese/bitcoin,ajtowns/bitcoin,bitcoinknots/bitcoin,sstone/bitcoin,andreaskern/bitcoin,instagibbs/bitcoin,jamesob/bitcoin,namecoin/namecore,achow101/bitcoin,ElementsProject/elements,rnicoll/bitcoin,bitcoinknots/bitcoin,GroestlCoin/GroestlCoin,domob1812/namecore,sipsorcery/bitcoin,domob1812/namecore,sipsorcery/bitcoin,fanquake/bitcoin,mm-s/bitcoin,jambolo/bitcoin,dscotese/bitcoin,ajtowns/bitcoin,instagibbs/bitcoin,jamesob/bitcoin,jambolo/bitcoin,n1bor/bitcoin,GroestlCoin/bitcoin,jlopp/statoshi,apoelstra/bitcoin,qtumproject/qtum,MeshCollider/bitcoin,Sjors/bitcoin,prusnak/bitcoin,jambolo/bitcoin,ElementsProject/elements,MarcoFalke/bitcoin,Xekyo/bitcoin,jlopp/statoshi,apoelstra/bitcoin,prusnak/bitcoin,MeshCollider/bitcoin,anditto/bitcoin,achow101/bitcoin,Sjors/bitcoin,MarcoFalke/bitcoin,n1bor/bitcoin,domob1812/bitcoin,bitcoinsSG/bitcoin,AkioNak/bitcoin,achow101/bitcoin,particl/particl-core,sipsorcery/bitcoin,namecoin/namecoin-core,tecnovert/particl-core,fujicoin/fujicoin,JeremyRubin/bitcoin,domob1812/namecore,fujicoin/fujicoin,fujicoin/fujicoin,mm-s/bitcoin,AkioNak/bitcoin,MarcoFalke/bitcoin,domob1812/bitcoin,namecoin/namecore,mruddy/bitcoin,andreaskern/bitcoin,prusnak/bitcoin,fanquake/bitcoin,GroestlCoin/GroestlCoin,Xekyo/bitcoin,GroestlCoin/bitcoin,MeshCollider/bitcoin,achow101/bitcoin,anditto/bitcoin,particl/particl-core