Improve --wait checking logic (fixes #128)
Improve --wait checking logic (fixes #128)

mirzawaqasahmed/pipework,midonet/pipework,ksmaheshkumar/pipework,OnePaaS/pipework,osrg/pipework,palfrey/pipework,YujiOshima/pipework,snowygoose/pipework,spheresh/pipework,wrenth04/pipework,Rakurai/pipework,deitch/pipework,awanke/pipework,bing6/pipework,SivagnanamCiena/pipework,haggaie/pipework,PeerXu/pipework,jpetazzo/pipework,JamesGuthrie/pipework,mrvicadai/pipework,abn/pipework,indykish/pipework,mej/pipework,zhouqingyu/pipework,hayderimran7/pipework,ONode/pipework,sharry007/pipework