Guard against spurious wakeups in devicediscoveryclient.cpp
Guard against spurious wakeups in devicediscoveryclient.cpp

Like most condition variable implementations, std::condition_variable may
wake up spuriously, even though it is not signalled (see
http://en.cppreference.com/w/cpp/thread/condition_variable/wait).  Since
the intention of blocking on the std::condition_variable in main is to
wait forever, add a loop to block again after spurious wakeups.

Change-Id: I19b7ee13650b9b80250f935e2099119611fa61b3
Signed-off-by: William Dieter <9bb7525fde505d89ea162e25d8631fd913572cc2@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/355
Tested-by: jenkins-iotivity <09cb29e8a2b473a2c978382eec13ee06fa017bda@opendaylight.org>
Reviewed-by: Sudarshan Prasad <18992b2df49d20c769d3f89a8cc0a9f38a9dccaa@intel.com>
(cherry picked from commit 73b122b0590bc350c1a451d7d05db86e3f0121d3)
Reviewed-on: https://gerrit.iotivity.org/gerrit/392

kartben/iotivity,santais/iotivity_1.1.0,santais/iotivity,iotivity/iotivity,tienfuc/iotivity-democlient-snap,WojciechLuczkow/iotivity,santais/iotivity_1.1,kartben/iotivity,WojciechLuczkow/iotivity,santais/iotivity_1.1.0,santais/iotivity_1.1,rzr/iotivity,rzr/iotivity,kartben/iotivity,santais/iotivity,kartben/iotivity,tienfuc/iotivity-democlient-snap,iotivity/iotivity,kartben/iotivity,rzr/iotivity,santais/iotivity_1.1,santais/iotivity_1.1,WojciechLuczkow/iotivity,tienfuc/iotivity-democlient-snap,santais/iotivity_1.1.0,rzr/iotivity,santais/iotivity_1.1,WojciechLuczkow/iotivity,iotivity/iotivity,rzr/iotivity,kartben/iotivity,tienfuc/iotivity-democlient-snap,santais/iotivity,tienfuc/iotivity-democlient-snap,iotivity/iotivity,tienfuc/iotivity-democlient-snap,WojciechLuczkow/iotivity,iotivity/iotivity,WojciechLuczkow/iotivity,tienfuc/iotivity-democlient-snap,kartben/iotivity,WojciechLuczkow/iotivity,santais/iotivity_1.1.0,santais/iotivity_1.1,iotivity/iotivity,tienfuc/iotivity-democlient-snap,santais/iotivity,santais/iotivity_1.1,santais/iotivity,tienfuc/iotivity-democlient-snap,santais/iotivity_1.1,santais/iotivity_1.1.0,santais/iotivity,iotivity/iotivity,tienfuc/iotivity-democlient-snap,kartben/iotivity,rzr/iotivity,iotivity/iotivity,santais/iotivity_1.1.0,WojciechLuczkow/iotivity,rzr/iotivity,santais/iotivity,santais/iotivity_1.1.0