[PTFM-8492] A potential fix for hanging issue

Sidenote: boost::this_thread::sleep() is deprecated in libboost
(we still use it at a few places, but reducing dependency on it)