Added helper function as workaround for VC++ bug in std::future::wait_for.