Guard against spurious wakeups in devicediscoveryserver.cpp
Guard against spurious wakeups in devicediscoveryserver.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: I97e89a1ec95d6ba65eeb7daff861ee0a65d03a7e
Signed-off-by: William Dieter <9bb7525fde505d89ea162e25d8631fd913572cc2@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/357
Tested-by: jenkins-iotivity <09cb29e8a2b473a2c978382eec13ee06fa017bda@opendaylight.org>
Reviewed-by: Sudarshan Prasad <18992b2df49d20c769d3f89a8cc0a9f38a9dccaa@intel.com>
(cherry picked from commit 5df6036cde74bf174d9d61b618d81f8d7034d6c4)
Reviewed-on: https://gerrit.iotivity.org/gerrit/391

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